Essential ADO.NET Development Techniques
To start coding with ADO.NET and SQL Server, you first need to connect to an instance of SQL Server. To do this, you need a connection string. A connection string is simply a string literal that contains all the parameters necessary to locate and log in to a server in a semicolon-delimited format. The following is an example:
"Data Source=SQLServer001;Initial Catalog=AdventureWorks2012;IntegratedSecurity=True"
This connection string tells ADO.NET to connect to a server called SQLServer001
, change to the AdventureWorks2012
database context, and use integrated Windows security to connect, which means it should use the credentials of the currently authenticated user (in web applications, ...
Get Microsoft® SQL Server 2012 Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.