migrating-to-microsoft-data-sqlclient

Migrate .NET projects from System.Data.SqlClient to Microsoft.Data.SqlClient.

19|2|Updated May 13, 2026
One-click install
npx skills add https://github.com/microsoft/upgrade-agent-plugins --skill migrating-to-microsoft-data-sqlclient
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrating-to-microsoft-data-sqlclient
Source: https://github.com/microsoft/upgrade-agent-plugins/tree/main/plugins/upgrade-agent/extenders/upgrade-dotnet/upgrade/skills/lazy/data/migrating-to-microsoft-data-sqlclient
Command: npx skills add https://github.com/microsoft/upgrade-agent-plugins --skill migrating-to-microsoft-data-sqlclient

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines the migration process of .NET projects from System.Data.SqlClient to Microsoft.Data.SqlClient, ensuring a smooth transition with minimal manual intervention.

Core Features & Use Cases

  • Automatic Dependency Updates: Automatically update package dependencies from System.Data.SqlClient to Microsoft.Data.SqlClient.
  • Code File Updates: Replace all System.Data.SqlClient usages with Microsoft.Data.SqlClient equivalents.
  • Connection String Validation: Validate and update connection strings for encryption changes.
  • Use Case: A developer can use this Skill to migrate a .NET application from .NET Framework to .NET Core or .NET 5/6, replacing System.Data.SqlClient with Microsoft.Data.SqlClient.

Quick Start

Use the migrating-to-microsoft-data-sqlclient skill to automatically migrate your .NET application to use Microsoft.Data.SqlClient.

Frequently Asked Questions about migrating-to-microsoft-data-sqlclient

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate .NET code from System.Data.SqlClient to Microsoft.Data.SqlClient?

Migrating from System.Data.SqlClient to Microsoft.Data.SqlClient involves updating package dependencies, replacing namespace usages in code files, and validating connection strings for encryption changes. This ensures compatibility with modern .NET applications.

What is the difference between System.Data.SqlClient and Microsoft.Data.SqlClient?

Microsoft.Data.SqlClient is the modern data provider for SQL Server supporting modern .NET frameworks, whereas System.Data.SqlClient is the legacy provider. Migrating involves updating dependencies, namespaces, and connection string configurations to ensure continued support and security updates.

Does migrating to Microsoft.Data.SqlClient require connection string changes?

Yes, migrating to Microsoft.Data.SqlClient requires connection string validation and updates, specifically for encryption changes. Adjusting these configurations ensures that the modern .NET application maintains secure and correct database connections.

Can I automatically update package references from System.Data.SqlClient to Microsoft.Data.SqlClient?

Yes, you can automatically update package references from System.Data.SqlClient to Microsoft.Data.SqlClient. The migration process handles dependency updates, namespace mapping, and code file replacements to streamline the transition with minimal manual intervention.

When should I not migrate to Microsoft.Data.SqlClient?

You should carefully evaluate migrating to Microsoft.Data.SqlClient if your project strictly targets legacy .NET Framework versions that lack compatibility. The process focuses on modern .NET applications, so check your target framework before updating dependencies and namespaces.