News

In the Era of .NET Core, Microsoft Revamps SQL Server Data Access

Microsoft announced a new data access driver for SQL Server that should be the path forward for data developers in the era of .NET Core.

As the traditional, Windows-only .NET Framework is basically being relegated to maintenance mode while the company devotes new development resources to the open source, cross-platform .NET Core, the SQL Server team needed a way to move to a single codebase to serve both camps.

That hasn't happened yet, but it's in the works. In the meantime, a preview of the new Microsoft.Data.SqlClient package is available via NuGet, providing the way forward instead of System.Data.SqlClient, the ADO.NET provider used to access SQL Server or Azure SQL Databases in .NET Framework.

"This new package supports both .NET Core and .NET Framework," said Vicky Harp, program manager on SqlClient and SQL Server Tools, in a blog post earlier this month. "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."

Also, as part of the aforementioned new development direction, she announced new functionality for the .NET Core version of the provider, the "long-awaited support for Always Encrypted" and support for Enclaves, "a protected region of memory within the SQL Server process [that] acts as a trusted execution environment for processing sensitive data inside the SQL Server engine."

She also announced two new features for SQL Server working on both .NET Framework and .NET Core:

  • Data Classification -- Available in Azure SQL Database and Microsoft SQL Server 2019 since CTP 2.0.
  • UTF-8 support -- Available in Microsoft SQL Server SQL Server 2019 since CTP 2.3.

Regarding the long-term goal of a unified code base, she said:

The binaries in the new package are based on the same code from System.Data.SqlClient in .NET Core and .NET Framework. This means there are multiple binaries in the package. In addition to the different binaries you would expect for supporting different operating systems, there are different binaries when you target .NET Framework versus when you target .NET Core. There was no magic code merge behind the scenes: we still have divergent code bases from .NET Framework and .NET Core (for now). This also means we still have divergent feature support between SqlClient targeting .NET Framework and SqlClient targeting .NET Core. If you want to migrate from .NET Framework to .NET Core but you are blocked because .NET Core does not yet support a feature (aside from Always Encrypted), the first preview release may not change that. But our top priority is bringing feature parity across those targets.

System.Data.SqlClient, for now, will continue to be supported, but only for fixing bugs and security issues, with all new development going to Microsoft.Data.SqlClient.

"Our roadmap has more frequent releases lighting up features in Core as fast as we can implement them," Harp said. "The long-term goal is a single code base and it will come to that over time, but the immediate need is feature support in SqlClient on .NET Core, so that is what we are focusing on, while still being able to deliver new SQL features to .NET Framework applications, too."

The Microsoft.Data.SqlClient feature roadmap calls for:

  • Azure Active Directory authentication providers (Core)
  • Active Directory Password
  • Managed Service Identity
  • Active Directory Integrated

In addition to the aforementioned merging of the SQL Server .NET Framework and .NET Core code bases, the engineering roadmap calls for open source assembly and a move to GitHub.

Microsoft.Data.SqlClient is set to graduate from preview to general availability sometime before the final releases of both SQL Server 2019 and .NET Core 3.0, both scheduled for the second half of this year.

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus

Featured

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

  • What's New for Python, Java in Visual Studio Code

    Microsoft announced March 2024 updates to its Python and Java extensions for Visual Studio Code, the open source-based, cross-platform code editor that has repeatedly been named the No. 1 tool in major development surveys.

Subscribe on YouTube