-
Notifications
You must be signed in to change notification settings - Fork 340
Feature Recipes
Home / Start building
Choose a task and continue in Microsoft Learn. The ADO.NET driver documentation hub covers the full learning path. These links take you to driver-specific explanations, prerequisites, and walkthroughs rather than standalone repository samples.
| I want to... | Microsoft Learn guide | Watch for |
|---|---|---|
| Configure a secure connection | Connection strings and encryption and certificate validation | Match the endpoint's capabilities and certificate identity; do not bypass trust validation. |
| Connect using Microsoft Entra ID | Microsoft Entra authentication | Choose a flow suitable for the host and review the 7.x Azure extension requirements. |
| Pass values safely | Commands and parameters | Parameters represent values, not arbitrary table names or SQL syntax. Match types and sizes to the schema. |
| Avoid blocking during I/O | Use the task-based async APIs and propagate cancellation. Async guidance | Do not share an active command/reader concurrently or block on async work unnecessarily. |
| Read a large binary/text value | SqlClient streaming support | Sequential access constrains access order; avoid materializing the entire value by accident. |
| Load many rows | Bulk copy operations | Decide column mappings, batching, transactions, identity handling, and failure recovery deliberately. |
| Group writes atomically | Transactions and concurrency | Assign the transaction to participating commands. API availability does not imply genuinely asynchronous implementation. |
| Handle transient failures | Configurable retry logic and high availability | Retry only operations whose effects are safe to repeat; avoid stacked retry policies. |
| Protect sensitive columns | SqlClient support for Always Encrypted | TLS protects transport; Always Encrypted has separate keys, permissions, and deployment requirements. |
| Use JSON or vector columns | JSON data and vector data | Confirm server capability and driver version; planned vector subtypes are not shipped features. |
Follow connection pooling guidance and use diagnostic counters to understand pool pressure. Keep connection lifetimes scoped to the work and release them promptly; increasing the maximum pool size is not a substitute for diagnosing leaked readers, long operations, or excessive concurrency.
Establish a representative baseline before changing packet size, retry behavior, MARS, or pooling switches. Change one factor at a time, using the same runtime, OS, network, and workload.
Check each article's driver, runtime, server, and platform requirements. Keep connection information outside application code, using the connection-information protection guidance. Adapt authentication, error handling, and cleanup to your application.
Next: Troubleshooting for a failing operation; Roadmap for capabilities not yet available.
Sources: the Microsoft Learn articles linked above.
Home | ADO.NET driver docs | Release notes | Support lifecycle
Report security vulnerabilities privately to MSRC. Never share credentials or access tokens in public reports.