Click here to Skip to main content
Rate this: bad
good
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 asp.net 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
good
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.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 481
1 Maciej Los 345
2 OriginalGriff 308
3 Yogesh Kumar Tyagi 304
4 Prakriti Goyal 200
0 OriginalGriff 6,367
1 Sergey Alexandrovich Kryukov 5,296
2 Maciej Los 3,384
3 Peter Leow 3,259
4 DamithSL 2,490


Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 15 May 2012
Copyright © CodeProject, 1999-2014
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