views:

246

answers:

4

hi to all,

i m creating an application, inwhich client has to acces a database stored in a remote location connnected through a live ip. how can i connect simply with a database server placed in LAN. both using sql server 2005 express edition. please refer me or help me on this

A: 

Set in your connection string IP address of remote server. E.g.

"Data source=192.168.0.13; Database=MyDb;User ID=my_user;password=12345"

where 192.168.0.13 is your remote server IP and MyDb is your database name.

elder_george
A: 

Also, make sure to configure your SQL Server Express to allow remote connections! Those are disabled by default after installation.

Check out the SQL Server Surface Configuration tool (if I'm not mistaken) to configure these settings.

Marc

marc_s
A: 

This not about programming. You have forward the port which Sql Server uses on modem.

JCasso
A: 

Hi, I've tried to connect with Asp.Net to MS SQLExpress DB using the following as per advised above:

But I get an error: "The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"

SQLExpress does have "Allow remote connections to this server" ticked.

Any ideas what I have done wrong ?

frank2009