Various Ways to Specify in ADO.NET Connection String

July 7th, 2012 | Posted by Vidya Vrat in .NET | ADO .NET | C#

Normally an ADO .NET connection string uses “server” or “data source” to specify the machine name \ sql server instance, your application will be connecting to.

data source = .\sql instance name
server = .\sql instance name

SqlConnection conn = newSqlConnection(@”data source = .\sql2012;
                                         integrated security = true;
                                         database = AdventureWorks”);

But there are few more ways to specify the same

address = .\ sql instance name
addr = .\ sql instance name
network address = .\ sql instance name

 

You can follow any responses to this entry through the RSS 2.0 You can leave a response, or trackback.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.