Sign in to follow this  
TFS_Waldo

[.net] SQL Server 2005 Express and Remote Connections (TCP/IP)?

Recommended Posts

Okay, this is a simple one. But I wanted to ask, as I don't have any means of testing it right now. I don't have the internet hooked up to my computer yet. =P Well, I have VS .NET 2005 Pro and SQL Server 2005 Express. The server name is default, SQLEXPRESS. And I have no problems whatsoever connecting to it on the local machine. But, if I enable the TCP/IP protocol, how can someone else (using a client app. I write) access the server, to read a database? I know when you create the Connection String for the 'SqlConnection' object you do "DataSource=.\\SQLEXPRESS;etc." for a local connection. But would you simply put "DataSource=127.0.0.1\\SQLEXPRESS", for example? Or is there some other way you have to do it? Thanks in advance, Matt U.

Share this post


Link to post
Share on other sites
From ConnectionStrings.com

Quote:

Standard Security:

"Data Source=Aron1;Initial Catalog=pubs;User Id=sa;Password=asdasd;"
- or -
"Server=Aron1;Database=pubs;User ID=sa;Password=asdasd;Trusted_Connection=False"
(both connection strings produces the same result)




Trusted Connection:

"Data Source=Aron1;Initial Catalog=pubs;Integrated Security=SSPI;"
- or -
"Server=Aron1;Database=pubs;Trusted_Connection=True;"
(both connection strings produces the same result)

(use serverName\instanceName as Data Source to use an specifik SQLServer instance)

Connect via an IP address:
"Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=pubs;User ID=sa;Password=asdasd;"
(DBMSSOCN=TCP/IP instead of Named Pipes, at the end of the Data Source is the port to use (1433 is the default))




Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this