Click here to Skip to main content
13,510,146 members
Rate this:
Please Sign up or sign in to vote.
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 project. is it a problem? if yes how can i have data access project (it's a class library) in internet?
Posted 14-May-12 1:18am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

1. EF doesn't matter. Set IP in Web Config: source = tcp:<ip>,<pot number="">
for ex: tcp:,1143
2. no any problem. when you publish the website it handles all resourced

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.180417.1 | Last Updated 15 May 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100