-
Notifications
You must be signed in to change notification settings - Fork 340
Getting Started
Home / Start building
Goal: connect securely, run a small query, and release the connection correctly.
The ADO.NET driver documentation hub is the starting point for learning SqlClient. Use its driver overview for concepts and getting-started tutorial for the complete walkthrough. The checklist below helps you prepare.
Choose a supported .NET runtime and driver release using Releases and support. Have a reachable SQL Server or Azure SQL database, an identity with the required permissions, and a certificate configuration trusted by your application host.
Installing the driver does not install SQL Server or grant database access.
- Follow Install Microsoft.Data.SqlClient to add the NuGet package at the selected supported patch version.
- For MDS 7.x driver-provided Entra authentication, also add the matching
Microsoft.Data.SqlClient.Extensions.Azurepackage. SQL authentication and Windows integrated security do not require this extension. - Use the
Microsoft.Data.SqlClientnamespace. Keep general ADO.NET types such asDbConnectionandSqlDbTypein their existing namespaces. - Supply connection settings through application configuration or a secret store. Require encryption and validate the server certificate; do not solve a trust error by quietly disabling validation.
- Follow the official getting-started tutorial. Begin with a small query using the identity and host configuration you will deploy.
- Dispose connections, commands, and readers when their work is complete. Use parameters for values rather than constructing SQL with user input.
Success looks like: a connection opens, the query returns the expected result, and all disposable resources are released. Repeat from the actual deployment environment; a successful developer-machine connection does not prove production authentication, certificates, or native assets are ready.
Identify whether the error is name resolution/networking, certificate validation, authentication, or database authorization. Use Troubleshooting instead of changing several settings at once.
Next: Feature guides.
Sources: Getting started, connection strings, Entra authentication.
Home | ADO.NET driver docs | Release notes | Support lifecycle
Report security vulnerabilities privately to MSRC. Never share credentials or access tokens in public reports.