Microsoft.Data.SqlClient 7.0.0.5705-ci

Prefix Reserved
This is a prerelease version of Microsoft.Data.SqlClient.

Requires NuGet 2.12 or higher.

dotnet add package Microsoft.Data.SqlClient --version 7.0.0.5705-ci
                    
NuGet\Install-Package Microsoft.Data.SqlClient -Version 7.0.0.5705-ci
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Microsoft.Data.SqlClient" Version="7.0.0.5705-ci" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Microsoft.Data.SqlClient" Version="7.0.0.5705-ci" />
                    
Directory.Packages.props
<PackageReference Include="Microsoft.Data.SqlClient" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Microsoft.Data.SqlClient --version 7.0.0.5705-ci
                    
#r "nuget: Microsoft.Data.SqlClient, 7.0.0.5705-ci"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Microsoft.Data.SqlClient@7.0.0.5705-ci
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Microsoft.Data.SqlClient&version=7.0.0.5705-ci&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Microsoft.Data.SqlClient&version=7.0.0.5705-ci&prerelease
                    
Install as a Cake Tool

Microsoft.Data.SqlClient

NuGet NuGet Downloads

Description

Microsoft.Data.SqlClient is the official .NET data provider for Microsoft SQL Server and Azure SQL databases. It provides access to SQL Server and encapsulates database-specific protocols, including Tabular Data Stream (TDS).

This library grew from a union of the two System.Data.SqlClient components which live independently in .NET and .NET Framework. Going forward, support for new SQL Server and Azure SQL features will only be implemented in Microsoft.Data.SqlClient.

Supportability

This package supports:

  • .NET Framework 4.6.2+
  • .NET 8.0+

Installation

Install the package via NuGet:

dotnet add package Microsoft.Data.SqlClient

Or via the Package Manager Console:

Install-Package Microsoft.Data.SqlClient

Getting Started

Basic Connection

using Microsoft.Data.SqlClient;

var connectionString = "Server=myserver;Database=mydb;Integrated Security=true;";

using var connection = new SqlConnection(connectionString);
await connection.OpenAsync();

Console.WriteLine("Connected successfully!");

Execute a Query

using Microsoft.Data.SqlClient;

var connectionString = "Server=myserver;Database=mydb;Integrated Security=true;";

using var connection = new SqlConnection(connectionString);
await connection.OpenAsync();

using var command = new SqlCommand("SELECT Id, Name FROM Customers", connection);
using var reader = await command.ExecuteReaderAsync();

while (await reader.ReadAsync())
{
    Console.WriteLine($"Id: {reader.GetInt32(0)}, Name: {reader.GetString(1)}");
}

Parameterized Query

using Microsoft.Data.SqlClient;

var connectionString = "Server=myserver;Database=mydb;Integrated Security=true;";

using var connection = new SqlConnection(connectionString);
await connection.OpenAsync();

using var command = new SqlCommand("SELECT * FROM Customers WHERE Id = @id", connection);
command.Parameters.AddWithValue("@id", customerId);

using var reader = await command.ExecuteReaderAsync();
// Process results...

Using Transactions

using Microsoft.Data.SqlClient;

using var connection = new SqlConnection(connectionString);
await connection.OpenAsync();

using var transaction = connection.BeginTransaction();

try
{
    using var command = new SqlCommand("INSERT INTO Orders (CustomerId, Total) VALUES (@customerId, @total)", connection, transaction);
    command.Parameters.AddWithValue("@customerId", customerId);
    command.Parameters.AddWithValue("@total", orderTotal);
    
    await command.ExecuteNonQueryAsync();
    await transaction.CommitAsync();
}
catch
{
    await transaction.RollbackAsync();
    throw;
}

Key Features

Feature Description
Cross-Platform Runs on Windows, Linux, and macOS
Azure AD Authentication Multiple Azure Active Directory authentication modes
Always Encrypted Client-side encryption for sensitive data
Connection Pooling Efficient connection management
TLS 1.3 Support Enhanced security with strict encryption mode
MARS Multiple Active Result Sets on a single connection
Async Programming Full async/await support
SqlBatch Batch multiple commands for improved performance
JSON/Vector Support Native support for JSON and Vector data types (SQL Server 2025+)

Commonly Used Types

Microsoft.Data.SqlClient.SqlConnection
Microsoft.Data.SqlClient.SqlCommand
Microsoft.Data.SqlClient.SqlDataReader
Microsoft.Data.SqlClient.SqlParameter
Microsoft.Data.SqlClient.SqlTransaction
Microsoft.Data.SqlClient.SqlException
Microsoft.Data.SqlClient.SqlParameterCollection
Microsoft.Data.SqlClient.SqlClientFactory
Microsoft.Data.SqlClient.SqlBulkCopy
Microsoft.Data.SqlClient.SqlConnectionStringBuilder

Authentication Methods

Method Connection String
SQL Server Authentication User ID=user;Password=pass;
Windows Authentication Integrated Security=true;
Azure AD Password Authentication=Active Directory Password;User ID=user;Password=pass;
Azure AD Integrated Authentication=Active Directory Integrated;
Azure AD Interactive Authentication=Active Directory Interactive;
Azure AD Managed Identity Authentication=Active Directory Managed Identity;
Azure AD Service Principal Authentication=Active Directory Service Principal;User ID=clientId;Password=clientSecret;
Azure AD Default Authentication=Active Directory Default;

Encryption Modes

Mode Description
Encrypt=Optional Encryption is used if available
Encrypt=Mandatory Encryption is required (default)
Encrypt=Strict TDS 8.0 with TLS 1.3 support

SNI (SQL Server Network Interface)

Two implementations are available:

Documentation

Release Notes

Release notes are available at: https://go.microsoft.com/fwlink/?linkid=2090501

Migrating from System.Data.SqlClient

If you're migrating from System.Data.SqlClient, see the porting cheat sheet for guidance.

Key changes:

  1. Change namespace from System.Data.SqlClient to Microsoft.Data.SqlClient
  2. Update package reference to Microsoft.Data.SqlClient
  3. Review connection string defaults (e.g., Encrypt=Mandatory is now the default)

License

This package is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

GitHub repositories (266)

Showing the top 20 popular GitHub repositories that depend on Microsoft.Data.SqlClient:

Repository Stars
microsoft/semantic-kernel
Integrate cutting-edge LLM technology quickly and easily into your apps
bitwarden/server
Bitwarden infrastructure/backend (API, database, Docker, etc).
DapperLib/Dapper
Dapper - a simple object mapper for .Net
dotnet/efcore
EF Core is a modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations.
abpframework/abp
Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
Sonarr/Sonarr
Smart PVR for newsgroup and bittorrent users.
Radarr/Radarr
Movie organizer/manager for usenet and torrent users.
dotnet/orleans
Cloud Native application framework for .NET
mRemoteNG/mRemoteNG
mRemoteNG is the next generation of mRemote, open source, tabbed, multi-protocol, remote connections manager.
HangfireIO/Hangfire
An easy way to perform background job processing in .NET and .NET Core applications. No Windows Service or separate process required
nopSolutions/nopCommerce
ASP.NET Core eCommerce software. nopCommerce is a free and open-source shopping cart.
StockSharp/StockSharp
Algorithmic trading and quantitative trading open source platform to develop trading robots (stock markets, forex, crypto, bitcoins, and options).
TechnitiumSoftware/DnsServer
Technitium DNS Server
MassTransit/MassTransit
Distributed Application Framework for .NET
dotnetcore/CAP
Distributed transaction solution in micro-service base on eventually consistency, also an eventbus with Outbox pattern
quartznet/quartznet
Quartz Enterprise Scheduler .NET
Prowlarr/Prowlarr
Prowlarr is an indexer manager/proxy built on the popular *arr .net/reactjs base stack to integrate with your various PVR apps, supporting management of both Torrent Trackers and Usenet Indexers.
Azure/azure-sdk-for-net
This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
danielgerlag/workflow-core
Lightweight workflow engine for .NET Standard
DotNetNext/SqlSugar
.Net aot ORM SqlServer ORM Mongodb ORM MySql 瀚高 Postgresql ORM DB2 Hana 高斯 Duckdb C# VB.NET Sqlite ORM Oracle ORM Mysql Orm 虚谷数据库 达梦 ORM 人大金仓 ORM 神通ORM C# ORM , C# ORM .NET ORM NET9 ORM .NET8 ORM ClickHouse ORM QuestDb ,TDengine ORM,OceanBase ORM,GaussDB ORM,Tidb ORM Object/Relational Mapping
Version Downloads Last Updated
7.0.0.5705-ci 0 3/6/2026
7.0.0 0 3/12/2026