Saturday, July 07, 2012

Various ways to specify in ADO .NET Connection String


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 = new SqlConnection(@"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

No comments:

Post a Comment