System.Data.SqlClient vs Microsoft.Data.SqlClient

System.Data.SqlClient vs Microsoft.Data.SqlClient

3 min read - 20 May, 2025

6.5 Million developers are using the wrong database library for their applications, and they don't even realise it.

Base on this article written May 8th 2019, you can check the library out on github.

The Microsoft.Data.SqlClient package, now available in preview on NuGet, will be the flagship data access driver for SQL Server going forward.

This new package supports both .NET Core and .NET Framework. Creating a new SqlClient in a new namespace allows both the old System.Data.SqlClient and new Microsoft.Data.SqlClient to live side-by-side. While not automatic, there is a pretty straightforward path for applications to move from the old to the new. Simply add a NuGet dependency on Microsoft.Data.SqlClient and update any using references or qualified references.

Today I was doing some basic database work, and I noticed that there are 2 libraries available when working with SQL Server in .net code. 

System.Data.SqlClient will continue to receive bug fixes and security updates, but no new features, according to Microsoft. 

System.Data.SqlClient is an older .NET ADO.NET provider for SQL Server, while Microsoft.Data.SqlClient is a newer, actively developed ADO.NET provider that replaces it, according to Microsoft. Microsoft.Data.SqlClient supports .NET Core and .NET Framework, and it's where new features are being implemented, according to Microsoft. 
 
Key Differences and Considerations:
  • New Feature Support:
    Microsoft.Data.SqlClient is the preferred option for newer .NET projects and when you want to leverage the latest SQL Server features. 
     
Security:
Microsoft.Data.SqlClient prioritizes security by enabling TLS encryption by default, while System.Data.SqlClient leaves some security configurations to the developer, according to Microsoft. 
 
Maintenance:
System.Data.SqlClient is being maintained for bug fixes and security, but no new features will be added. 
 
Backward Compatibility:
Microsoft.Data.SqlClient is designed to be mostly drop-in compatible with System.Data.SqlClient, so transitioning should be relatively straightforward. 
 
NuGet Packages:
Microsoft.Data.SqlClient is available as a NuGet package, while System.Data.SqlClient is part of the .NET Framework. 
 
Performance:
While both libraries provide database connectivity to SQL Server, some performance differences have been observed between them. 

Nuget versions for System.Data.SqlClient - here 

 

Nuget versions for Microsoft.Data.SqlClient - here

 
 

Summary

It appears that Microsoft.Data.SqlClient is a newer library aimed at the later database versions like SQL Server 2025, however, a quick look on nuget and it does appear that developers are continuing to use the older library.

Have you migrated yet?

 
programmingdotnet.net
Key Differences and Considerations between System.Data.Sqlclient vs Microsoft.Data.Sqlclient
Published Tuesday, 20 May 2025


Related Articles