Blog Post

SQL Server Blog
3 MIN READ

Announcement: System.Data.SqlClient package is now deprecated

DavidEngelMS's avatar
DavidEngelMS
Icon for Microsoft rankMicrosoft
Aug 23, 2024

We announced Microsoft.Data.SqlClient in the first half of 2019 and shipped the first stable package later that year. That release coincided with .NET Core 3.0. We’ve been developing Microsoft.Data.SqlClient in the dotnet/SqlClient repo since that time, over the last five years. It’s now time to start the deprecation process for the System.Data.SqlClient package. We plan to take a staged process to deprecation, with the intent to align support changes and associated code transition activities between these libraries to natural migration points between .NET major versions.

 

All System.Data.SqlClient users are encouraged to transition to Microsoft.Data.SqlClient. We offer improvements and significantly higher support via the Microsoft.Data.SqlClient package.

Plan

We intend to deprecate the System.Data.SqlClient package in stages.

  • Before .NET 9 GA:
    • Publish a new 5.0.0 package, including the following changes.
    • Remove support for .NET 7 and earlier and .NET Framework 4.6.1 and earlier.
    • Publish assets for the following target frameworks: .NET 8, .NET Framework 4.6.2, .NET Standard 2.0.
    • Add Obsolete attributes to .NET 8 and .NET Standard 2.0 assets. This will generate new warnings for .NET 8+ and .NET Standard users.
    • Continue to offer security servicing, for .NET 8, and .NET Framework 4.6.2+ application users.
  • After .NET 9 GA:
    • No change
    • We will not support this package for .NET 9+ application users.
  • After .NET 8 EOL:
    • Remove support for .NET 8 users (the .NET 8 library will be removed).
    • Maintain support for .NET Framework 4.6.2+ users.
    • Security servicing will be provided via .NET Framework, not the package, at that point.
    • We do not expect to update the package again after this point.
    • We will not mark the package as deprecated since it will only support .NET Framework users with an implementation provided by .NET Framework.

We will remove support in the package for unsupported .NET and .NET Framework versions at various stages of this deprecation plan. Users affected by those changes are encouraged to move to a supported .NET or .NET Framework version and to adopt the Microsoft.Data.SqlClient package.

 

We decided to remove support for .NET 6 since it will go EOL shortly after this new package is released, even though .NET 6 will still be supported at the time. Publishing a .NET 8 library significantly simplifies the plan, both in terms of what we will deliver and what we need to explain.

 

For .NET dates, see .NET Releases. .NET 9 will GA in November of this year. .NET 8 will go EOL in November, 2026.

The current package version of System.Data.SqlClient is 4.8.6, at the time of writing. These changes will be made with a 5.0.0 version and later.

 

Note: This deprecation doesn’t apply to the System.Data.SqlClient namespace in .NET Framework.

Microsoft.Data.SqlClient

Daily downloads of Microsoft.Data.SqlClient on nuget.org are nearing 50% higher than System.Data.SqlClient. We expect the gap in usage between the two libraries will continue to increase. Microsoft.Data.SqlClient is the best library we offer to access SQL Server.

 

We are committed to providing high-quality, performance-driven, and secure data access technologies. We strongly encourage users to transition to Microsoft.Data.SqlClient. It is actively maintained and supports the latest SQL Server features.

How to migrate?

Add the NuGet package to your project, then update your references and using statements. Our porting cheat sheet provides a step-by-step set of changes you may need to make.

 

  1. Update your project references: Replace references to System.Data.SqlClient with Microsoft.Data.SqlClient.
  2. Modify your using statements: Update your using statements in your code files from System.Data.SqlClient to Microsoft.Data.SqlClient.
  3. Test your application: Thoroughly test your application to ensure that it works as expected after the migration.

We also plan to support semi-automatic migration via .NET Upgrade Assistant.

 

Support & Feedback: If you have any questions or need assistance with the migration, please reach out through our official support channels or join the discussion on our GitHub repository.

 

Resources

Published Aug 23, 2024
Version 1.0
  • Irritated's avatar
    Irritated
    Copper Contributor

    So you deprecated System.Data.SqlClient without first updated dependent features such as typed datasets? When you add a typed dataset to a NET 8 project the System.Data.SqlClient namespace and libraries do not exist and after adding it a ton of warnings about being deprecated are displayed.

    This is bad development practice to deprecate the objects before updating the dependent features such as datasets. Some of us want to use ADO and datasets for some projects.

     

    • Irritated's avatar
      Irritated
      Copper Contributor

      I am also quite irritated about the new NET versioning and development cycle where each version of NET only lasts for a couple years and falls out of support. Is there a reason NET 7 could not have been NET 6.1 and NET 8 be NET 6.2 and NET 9 be NET 6.3 so that developers are forced to migrate their code every couple years? Personally, I would rather just stick with Net Framework 4.8

    • DavidEngelMS's avatar
      DavidEngelMS
      Icon for Microsoft rankMicrosoft

      Noted.

      You might want to check out Entity Framework Core, though. Datasets are considered legacy and development efforts have been focused on EF Core for quite a long time now.

      Datasets and related classes are legacy .NET Framework technologies from the early 2000s that enable applications to work with data in memory while the applications are disconnected from the database. The technologies are especially useful for applications that enable users to modify data and persist the changes back to the database. Although datasets have proven to be a very successful technology, we recommend that new .NET applications use Entity Framework Core. Entity Framework provides a more natural way to work with tabular data as object models, and it has a simpler programming interface.

  • venramesh's avatar
    venramesh
    Copper Contributor

    Why Microsoft is re-inventing the wheel, very very disappointing upon noticing depreciated under version 4.9 from 4.8.6. There are many things where Entity Framework Core don't work. Very complex queries were easily solved through stored procedures only.