Trying to understand the ADO.NET connection string
I found an example of a connection string on GoDotnet http://samples.gotdotnet.com/quickst...ldtreader.aspx . But I am having difficulty understanding the connection string. With ADODB I would usully use the following connection string.
Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Database ;Data Source=Server
The connection string in the example is as follows
VB Code:
Dim mySqlConnection as SqlConnection = new SqlConnection("server=(local)\VSdotNET;Trusted_Connection=yes;database=northwind")
The bit I don't understand is server=(local)\VSdotNET
How do I change this to point at the SQL server on the network when I am developing on my local machine?
Please rate this post if it was useful for you!
Please try to search before creating a new post,
Please format code using [ code ][ /code ], and
Post sample code, error details & problem details
I have never used this style connectionstring with ADODB so I do not know how to change it. server=(local)\VSdotNET;Trusted_Connection=yes;database=northwind
Try adding the user name & password bit as above to your connection string...
UID=SQLServerUserName; pwd=AnyOldPassword
Please rate this post if it was useful for you!
Please try to search before creating a new post,
Please format code using [ code ][ /code ], and
Post sample code, error details & problem details
I will only make a successful connection when I use the sa userid and password. I can use my userid and password to connect through SQL Analyser and Enterprise manager but it will fail when added to the connection string.