Microsoft SqlClient Data Provider for SQL Server

This .NET Framework Class Library is provided by Microsoft. The main functionality of the class library is contained in the file Microsoft.Data.SqlClient.dll.

Add a reference to the assembly Microsoft.Data.SqlClient and include the Microsoft.Data.SqlClient namespace. Instantiate a new SqlConnection connection object. Set the connection string and open the connection.

VB.NET code sample
Imports Microsoft.Data.SqlClient
Dim myConnection As SqlConnection = New SqlConnection()
myConnection.ConnectionString = myConnectionString
myConnection.Open()
' execute queries, etc
myConnection.Close()
C# code sample
using Microsoft.Data.SqlClient;
SqlConnection myConnection = new SqlConnection();
myConnection.ConnectionString = myConnectionString;
myConnection.Open();
// execute queries, etc
myConnection.Close();

Description

Microsoft.Data.SqlClient is a data provider for Microsoft SQL Server and Azure SQL Database. It is a union of the two System.Data.SqlClient components which live independently in .NET Framework and .NET Core.

Support for new SQL Server features will be implemented only in Microsoft.Data.SqlClient. If you do not need any of those newer features it's fine to stay on System.Data.SqlClient as it will be actively maintained.

Microsoft.Data.SqlClient supports the following environments:
.NET Framework 4.6+
.NET Core 2.1+
.NET Standard 2.0+

More info about this class library can be found at the Microsoft product page.

Download

This .NET Framework Class Library, Microsoft SqlClient Data Provider for SQL Server, can be downloaded here.

Connection Strings

The Microsoft SqlClient Data Provider for SQL Server class library can be used to connect to the following data sources by using the following connection string references:

SQL ServerSQL Server 2019SQL Server 2017SQL Server 2016SQL Server 2014SQL Server 2012SQL Server 2008SQL Server 2005SQL Server 2000SQL Server 7.0Azure SQL Database