Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
hi experts

we have a static ip that comes to our switch and all servers are able to connect to internet.
one of the servers is for sqlserver 2008 .

i published our website to internet but i must use our local sqlserver because other local applications are connecting to it.

but 2 problems:

1. i don't know how to specify the ip to connection string (using EF4 SQL first)
2. the solution contains many projects and 1 project is for data access and EF4 but i published the asp.net project. is it a problem? if yes how can i have data access project (it's a class library) in internet?
Posted

A) You have one single static IP, and a router with NAT?
If so: use static ip also on the intranet. Use local DNS server, or simply NetBios names of the server.
B) You want to publish the SQL service to the internet?
Dont do that! Allow only the front-end (web server) to be accessed from outside, and only the http ports! Dont use the WAN IP on the LAN!
Answer to you questions:
1) you can use the IP address as you would use the hostname in the connection string
2) I dont understand. Please be more precise.

Second interpretation:
You have a web server outside your LAN. And you want to access the SQL server from the web server via your router?
Well... that's not a good idea. You can do it with port forwarding and so on, but this is not the way. There was a http binder in SQL 2000, but I think there is no more.
But you can concentrate all you business logic inside your LAN, and publish a WCF or other kind of service via https to your frontend. But you should leave only the presentation layer in it.
 
Share this answer
 
1. EF doesn't matter. Set IP in Web Config: source = tcp:<ip>,<pot number="">
for ex: tcp:11.223.2.1,1143
2. no any problem. when you publish the website it handles all resourced
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900