From 43010f7edb5ae534d186dbb617f820809069101c Mon Sep 17 00:00:00 2001
From: Paul Medynski <31868385+paulmedynski@users.noreply.github.com>
Date: Tue, 10 Mar 2026 15:21:17 -0300
Subject: [PATCH 01/10] Updated dependencies to latest available versions.
---
.devcontainer/setup-sqlserver.sh | 0
.devcontainer/sqlserver-entrypoint.sh | 0
Directory.Packages.props | 61 ++++++++-----------
.../tests/Directory.Packages.props | 14 +++--
.../DataCommon/ManagedIdentityProvider.cs | 5 +-
tools/Directory.Packages.props | 10 +--
6 files changed, 43 insertions(+), 47 deletions(-)
mode change 100755 => 100644 .devcontainer/setup-sqlserver.sh
mode change 100755 => 100644 .devcontainer/sqlserver-entrypoint.sh
diff --git a/.devcontainer/setup-sqlserver.sh b/.devcontainer/setup-sqlserver.sh
old mode 100755
new mode 100644
diff --git a/.devcontainer/sqlserver-entrypoint.sh b/.devcontainer/sqlserver-entrypoint.sh
old mode 100755
new mode 100644
diff --git a/Directory.Packages.props b/Directory.Packages.props
index 1311dafa09..f56055755e 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -50,37 +50,17 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
+
-
-
@@ -102,7 +82,7 @@
-
+
@@ -111,21 +91,21 @@
-
-
+
+
-
+
-
-
-
+
+
+
-
-
-
+
+
+
@@ -138,6 +118,17 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Microsoft.Data.SqlClient/tests/Directory.Packages.props b/src/Microsoft.Data.SqlClient/tests/Directory.Packages.props
index e8d684f944..8587e0736d 100644
--- a/src/Microsoft.Data.SqlClient/tests/Directory.Packages.props
+++ b/src/Microsoft.Data.SqlClient/tests/Directory.Packages.props
@@ -3,11 +3,15 @@
-
-
+
+
+
+
+
+
+
+
+
diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/DataCommon/ManagedIdentityProvider.cs b/src/Microsoft.Data.SqlClient/tests/ManualTests/DataCommon/ManagedIdentityProvider.cs
index 0e590be0f9..baafec4205 100644
--- a/src/Microsoft.Data.SqlClient/tests/ManualTests/DataCommon/ManagedIdentityProvider.cs
+++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/DataCommon/ManagedIdentityProvider.cs
@@ -49,7 +49,8 @@ public override async Task AcquireTokenAsync(
TokenRequestContext context = new([scope]);
- TokenCredentialOptions options = new()
+ ManagedIdentityCredentialOptions options = new(
+ ManagedIdentityId.FromUserAssignedClientId(parameters.UserId))
{
AuthorityHost = new Uri(parameters.Authority)
};
@@ -58,7 +59,7 @@ public override async Task AcquireTokenAsync(
ManagedIdentityCredential credential =
_credentialCache.GetOrAdd(
parameters.UserId,
- (_) => new(parameters.UserId, options));
+ (_) => new(options));
// Set up a cancellation token based on the authentication timeout,
// ignoring overflow since this is just test code.
diff --git a/tools/Directory.Packages.props b/tools/Directory.Packages.props
index e0f9ef7b88..ff5dc7caa9 100644
--- a/tools/Directory.Packages.props
+++ b/tools/Directory.Packages.props
@@ -6,13 +6,13 @@
-
+
-
-
+
+
-
-
+
+
From b85e4f9ea8fe2ee4e913b34486851479ed6813c4 Mon Sep 17 00:00:00 2001
From: Paul Medynski <31868385+paulmedynski@users.noreply.github.com>
Date: Wed, 11 Mar 2026 14:03:45 -0300
Subject: [PATCH 02/10] Fixed build errors/warnings in the samples project.
---
doc/Directory.Packages.props | 7 ++++---
.../AzureKeyVaultProvider_ColumnEncryptionKeyCacheScope.cs | 4 ++++
.../ConnectionStringSettings_RetrieveFromConfigByName.cs | 4 +++-
...onnectionStringSettings_RetrieveFromConfigByProvider.cs | 4 +++-
doc/samples/ConnectionStrings_Encrypt.cs | 4 +++-
.../CustomDeviceCodeFlowAzureAuthenticationProvider.cs | 2 ++
doc/samples/IBinarySerialize.cs | 2 ++
doc/samples/IDbCommand_CommandTimeout.cs | 2 ++
doc/samples/Isolation_Snapshot1.cs | 2 ++
doc/samples/Microsoft.Data.SqlClient.Samples.csproj | 1 +
.../csharp/DataWorks_IBinarySerialize_Sample.cs | 2 ++
.../csharp/SqlUserDefinedTypeAttribute_Type1.cs | 4 +++-
doc/samples/SqlBytes_Stream.cs | 2 ++
doc/samples/SqlClientDiagnosticCounter.cs | 4 +++-
doc/samples/SqlClientEventSource.cs | 4 +++-
doc/samples/SqlClientFactory_DataSourceEnumerator.cs | 2 ++
doc/samples/SqlClient_AsyncProgramming_MultipleCommands.cs | 2 ++
.../SqlClient_AsyncProgramming_MultipleCommandsEx.cs | 2 ++
doc/samples/SqlClient_AsyncProgramming_SqlTransaction.cs | 2 ++
doc/samples/SqlCommandBuilder_Create.cs | 2 ++
doc/samples/SqlCommand_Cancel.cs | 2 ++
doc/samples/SqlCommand_CommandText.cs | 2 ++
doc/samples/SqlCommand_SqlCommand1.cs | 2 ++
doc/samples/SqlConfigurableRetryLogic_OpenConnection.cs | 2 ++
doc/samples/SqlConfigurableRetryLogic_SqlCommand.cs | 2 ++
doc/samples/SqlConnectionStringBuilder_TryGetValue.cs | 2 ++
doc/samples/SqlConnection_AccessTokenCallback.cs | 2 ++
doc/samples/SqlConnection_ConnectionString1.cs | 2 ++
doc/samples/SqlDataAdapter_Concurrency.cs | 2 ++
doc/samples/SqlDataAdapter_Events.cs | 4 +++-
doc/samples/SqlDataAdapter_FillDataSet.cs | 4 +++-
doc/samples/SqlDataAdapter_MergeIdentity.cs | 4 +++-
doc/samples/SqlDataAdapter_Paging.cs | 4 +++-
doc/samples/SqlDataAdapter_Properties.cs | 4 +++-
doc/samples/SqlDataAdapter_RowUpdated.cs | 4 ++++
doc/samples/SqlDataAdapter_SelectCommand.cs | 2 ++
doc/samples/SqlDataAdapter_Update.cs | 4 +++-
doc/samples/SqlParameterCollection_Add6.cs | 2 ++
doc/samples/SqlParameterCollection_Count.cs | 2 ++
doc/samples/SqlParameterCollection_Remove.cs | 2 ++
doc/samples/SqlParameter_Value.cs | 2 ++
doc/samples/SqlRowUpdatingEventArgs.cs | 4 ++++
doc/samples/SqlUserDefinedType1.cs | 2 ++
doc/samples/SspiContextProvider_CustomProvider.cs | 2 ++
doc/samples/TransactionIsolationLevels.cs | 4 +++-
45 files changed, 110 insertions(+), 16 deletions(-)
diff --git a/doc/Directory.Packages.props b/doc/Directory.Packages.props
index 66b295ed74..e67b8b08ab 100644
--- a/doc/Directory.Packages.props
+++ b/doc/Directory.Packages.props
@@ -2,8 +2,9 @@
-
-
-
+
+
+
+
diff --git a/doc/samples/AzureKeyVaultProvider_ColumnEncryptionKeyCacheScope.cs b/doc/samples/AzureKeyVaultProvider_ColumnEncryptionKeyCacheScope.cs
index e7f1b1716f..21722bc5bc 100644
--- a/doc/samples/AzureKeyVaultProvider_ColumnEncryptionKeyCacheScope.cs
+++ b/doc/samples/AzureKeyVaultProvider_ColumnEncryptionKeyCacheScope.cs
@@ -1,3 +1,5 @@
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
using System.Collections.Generic;
using Azure.Identity;
using Microsoft.Data.SqlClient;
@@ -8,7 +10,9 @@ namespace AzureKeyVaultProvider_ColumnEncryptionKeyCacheScope
//
class Program
{
+#pragma warning disable CS0649 // Field is never assigned to
private static string connectionString;
+#pragma warning restore CS0649
static void Main()
{
diff --git a/doc/samples/ConnectionStringSettings_RetrieveFromConfigByName.cs b/doc/samples/ConnectionStringSettings_RetrieveFromConfigByName.cs
index c18562ee65..64c4d4d87c 100644
--- a/doc/samples/ConnectionStringSettings_RetrieveFromConfigByName.cs
+++ b/doc/samples/ConnectionStringSettings_RetrieveFromConfigByName.cs
@@ -1,4 +1,6 @@
-namespace ConnectionStringSettings_RetrieveFromConfigByName;
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
+namespace ConnectionStringSettings_RetrieveFromConfigByName;
using System;
using System.Configuration;
diff --git a/doc/samples/ConnectionStringSettings_RetrieveFromConfigByProvider.cs b/doc/samples/ConnectionStringSettings_RetrieveFromConfigByProvider.cs
index 645b30d744..0627b20902 100644
--- a/doc/samples/ConnectionStringSettings_RetrieveFromConfigByProvider.cs
+++ b/doc/samples/ConnectionStringSettings_RetrieveFromConfigByProvider.cs
@@ -1,4 +1,6 @@
-namespace ConnectionStringSettings_RetrieveFromConfigByProvider;
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
+namespace ConnectionStringSettings_RetrieveFromConfigByProvider;
using System;
using System.Data;
diff --git a/doc/samples/ConnectionStrings_Encrypt.cs b/doc/samples/ConnectionStrings_Encrypt.cs
index f94e75b520..ba050d65d1 100644
--- a/doc/samples/ConnectionStrings_Encrypt.cs
+++ b/doc/samples/ConnectionStrings_Encrypt.cs
@@ -1,4 +1,6 @@
-namespace ConnectionStrings_Encrypt;
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
+namespace ConnectionStrings_Encrypt;
using System;
using System.Configuration;
diff --git a/doc/samples/CustomDeviceCodeFlowAzureAuthenticationProvider.cs b/doc/samples/CustomDeviceCodeFlowAzureAuthenticationProvider.cs
index c3ae174c1c..defdfe6055 100644
--- a/doc/samples/CustomDeviceCodeFlowAzureAuthenticationProvider.cs
+++ b/doc/samples/CustomDeviceCodeFlowAzureAuthenticationProvider.cs
@@ -1,3 +1,5 @@
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
//
using System;
using System.Collections.Generic;
diff --git a/doc/samples/IBinarySerialize.cs b/doc/samples/IBinarySerialize.cs
index 5e73c47de8..b71e17adb0 100644
--- a/doc/samples/IBinarySerialize.cs
+++ b/doc/samples/IBinarySerialize.cs
@@ -1,3 +1,5 @@
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
using System;
using System.IO;
using System.Data;
diff --git a/doc/samples/IDbCommand_CommandTimeout.cs b/doc/samples/IDbCommand_CommandTimeout.cs
index b4118bac9e..e20660979f 100644
--- a/doc/samples/IDbCommand_CommandTimeout.cs
+++ b/doc/samples/IDbCommand_CommandTimeout.cs
@@ -1,3 +1,5 @@
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
#if NETFRAMEWORK
namespace IDbCommand_CommandTimeout;
diff --git a/doc/samples/Isolation_Snapshot1.cs b/doc/samples/Isolation_Snapshot1.cs
index 5be53b51fa..4e16fcfa75 100644
--- a/doc/samples/Isolation_Snapshot1.cs
+++ b/doc/samples/Isolation_Snapshot1.cs
@@ -1,3 +1,5 @@
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
namespace Isolation_Snapshot1;
using System;
diff --git a/doc/samples/Microsoft.Data.SqlClient.Samples.csproj b/doc/samples/Microsoft.Data.SqlClient.Samples.csproj
index e66e098c7d..b95a33b551 100644
--- a/doc/samples/Microsoft.Data.SqlClient.Samples.csproj
+++ b/doc/samples/Microsoft.Data.SqlClient.Samples.csproj
@@ -16,6 +16,7 @@
+
diff --git a/doc/samples/Microsoft.SqlServer.Server/csharp/DataWorks_IBinarySerialize_Sample.cs b/doc/samples/Microsoft.SqlServer.Server/csharp/DataWorks_IBinarySerialize_Sample.cs
index 726d3b5f89..add4425ae3 100644
--- a/doc/samples/Microsoft.SqlServer.Server/csharp/DataWorks_IBinarySerialize_Sample.cs
+++ b/doc/samples/Microsoft.SqlServer.Server/csharp/DataWorks_IBinarySerialize_Sample.cs
@@ -1,3 +1,5 @@
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
using System;
using System.IO;
using Microsoft.SqlServer.Server;
diff --git a/doc/samples/Microsoft.SqlServer.Server/csharp/SqlUserDefinedTypeAttribute_Type1.cs b/doc/samples/Microsoft.SqlServer.Server/csharp/SqlUserDefinedTypeAttribute_Type1.cs
index 51352596c6..63c3d50141 100644
--- a/doc/samples/Microsoft.SqlServer.Server/csharp/SqlUserDefinedTypeAttribute_Type1.cs
+++ b/doc/samples/Microsoft.SqlServer.Server/csharp/SqlUserDefinedTypeAttribute_Type1.cs
@@ -1,4 +1,6 @@
-namespace SqlUserDefinedTypeAttribute_Type1;
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
+namespace SqlUserDefinedTypeAttribute_Type1;
//-----------------------------------------------------------------------------
//
diff --git a/doc/samples/SqlBytes_Stream.cs b/doc/samples/SqlBytes_Stream.cs
index 0f7532da9c..f78bcc186a 100644
--- a/doc/samples/SqlBytes_Stream.cs
+++ b/doc/samples/SqlBytes_Stream.cs
@@ -1,3 +1,5 @@
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
#if NETFRAMEWORK
namespace SqlBytes_Stream;
diff --git a/doc/samples/SqlClientDiagnosticCounter.cs b/doc/samples/SqlClientDiagnosticCounter.cs
index 6f78fa8b22..187b877a2f 100644
--- a/doc/samples/SqlClientDiagnosticCounter.cs
+++ b/doc/samples/SqlClientDiagnosticCounter.cs
@@ -1,4 +1,6 @@
-namespace SqlClientDiagnosticCounter;
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
+namespace SqlClientDiagnosticCounter;
//
using System;
diff --git a/doc/samples/SqlClientEventSource.cs b/doc/samples/SqlClientEventSource.cs
index 532b1d88e3..09c0b97f64 100644
--- a/doc/samples/SqlClientEventSource.cs
+++ b/doc/samples/SqlClientEventSource.cs
@@ -1,4 +1,6 @@
-namespace SqlClientEventSource;
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
+namespace SqlClientEventSource;
//
using System;
diff --git a/doc/samples/SqlClientFactory_DataSourceEnumerator.cs b/doc/samples/SqlClientFactory_DataSourceEnumerator.cs
index 875a75446f..2781aac91c 100644
--- a/doc/samples/SqlClientFactory_DataSourceEnumerator.cs
+++ b/doc/samples/SqlClientFactory_DataSourceEnumerator.cs
@@ -1,3 +1,5 @@
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
namespace SqlClientFactory_DataSourceEnumerator;
//
diff --git a/doc/samples/SqlClient_AsyncProgramming_MultipleCommands.cs b/doc/samples/SqlClient_AsyncProgramming_MultipleCommands.cs
index a2814ff5f0..5fa366b65a 100644
--- a/doc/samples/SqlClient_AsyncProgramming_MultipleCommands.cs
+++ b/doc/samples/SqlClient_AsyncProgramming_MultipleCommands.cs
@@ -1,3 +1,5 @@
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
namespace SqlClient_AsyncProgramming_MultipleCommands;
using System;
diff --git a/doc/samples/SqlClient_AsyncProgramming_MultipleCommandsEx.cs b/doc/samples/SqlClient_AsyncProgramming_MultipleCommandsEx.cs
index 552e977e15..b51f47f3b5 100644
--- a/doc/samples/SqlClient_AsyncProgramming_MultipleCommandsEx.cs
+++ b/doc/samples/SqlClient_AsyncProgramming_MultipleCommandsEx.cs
@@ -1,3 +1,5 @@
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
namespace SqlClient_AsyncProgramming_MultipleCommandsEx;
using System;
diff --git a/doc/samples/SqlClient_AsyncProgramming_SqlTransaction.cs b/doc/samples/SqlClient_AsyncProgramming_SqlTransaction.cs
index b9c94abaf6..a8aae79656 100644
--- a/doc/samples/SqlClient_AsyncProgramming_SqlTransaction.cs
+++ b/doc/samples/SqlClient_AsyncProgramming_SqlTransaction.cs
@@ -1,3 +1,5 @@
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
namespace SqlClient_AsyncProgramming_SqlTransaction;
using System;
diff --git a/doc/samples/SqlCommandBuilder_Create.cs b/doc/samples/SqlCommandBuilder_Create.cs
index b21847b7f5..79a9543252 100644
--- a/doc/samples/SqlCommandBuilder_Create.cs
+++ b/doc/samples/SqlCommandBuilder_Create.cs
@@ -1,3 +1,5 @@
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
using System;
using System.Data;
using Microsoft.Data.SqlClient;
diff --git a/doc/samples/SqlCommand_Cancel.cs b/doc/samples/SqlCommand_Cancel.cs
index bf8b163f61..907e5a913d 100644
--- a/doc/samples/SqlCommand_Cancel.cs
+++ b/doc/samples/SqlCommand_Cancel.cs
@@ -1,3 +1,5 @@
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
namespace SqlCommand_Cancel;
//
diff --git a/doc/samples/SqlCommand_CommandText.cs b/doc/samples/SqlCommand_CommandText.cs
index 76e1ccbed7..1cc5c8d113 100644
--- a/doc/samples/SqlCommand_CommandText.cs
+++ b/doc/samples/SqlCommand_CommandText.cs
@@ -1,3 +1,5 @@
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
#if NETFRAMEWORK
namespace SqlCommand_CommandText;
diff --git a/doc/samples/SqlCommand_SqlCommand1.cs b/doc/samples/SqlCommand_SqlCommand1.cs
index da4c1adcc1..115d4e98a1 100644
--- a/doc/samples/SqlCommand_SqlCommand1.cs
+++ b/doc/samples/SqlCommand_SqlCommand1.cs
@@ -1,3 +1,5 @@
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
#if NETFRAMEWORK
namespace SqlCommand_SqlCommand1;
diff --git a/doc/samples/SqlConfigurableRetryLogic_OpenConnection.cs b/doc/samples/SqlConfigurableRetryLogic_OpenConnection.cs
index b31d4cfbb0..33381c0b78 100644
--- a/doc/samples/SqlConfigurableRetryLogic_OpenConnection.cs
+++ b/doc/samples/SqlConfigurableRetryLogic_OpenConnection.cs
@@ -1,3 +1,5 @@
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
namespace SqlConfigurableRetryLogic_OpenConnection;
using System;
diff --git a/doc/samples/SqlConfigurableRetryLogic_SqlCommand.cs b/doc/samples/SqlConfigurableRetryLogic_SqlCommand.cs
index 63f7c70ebe..ac8b11e435 100644
--- a/doc/samples/SqlConfigurableRetryLogic_SqlCommand.cs
+++ b/doc/samples/SqlConfigurableRetryLogic_SqlCommand.cs
@@ -1,3 +1,5 @@
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
namespace SqlConfigurableRetryLogic_SqlCommand;
using System;
diff --git a/doc/samples/SqlConnectionStringBuilder_TryGetValue.cs b/doc/samples/SqlConnectionStringBuilder_TryGetValue.cs
index 257b50569e..807a866279 100644
--- a/doc/samples/SqlConnectionStringBuilder_TryGetValue.cs
+++ b/doc/samples/SqlConnectionStringBuilder_TryGetValue.cs
@@ -1,3 +1,5 @@
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
namespace SqlConnectionStringBuilder_TryGetValue;
using System;
diff --git a/doc/samples/SqlConnection_AccessTokenCallback.cs b/doc/samples/SqlConnection_AccessTokenCallback.cs
index 05dee19ccb..0f61f7fbaa 100644
--- a/doc/samples/SqlConnection_AccessTokenCallback.cs
+++ b/doc/samples/SqlConnection_AccessTokenCallback.cs
@@ -1,3 +1,5 @@
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
namespace SqlConnection_AccessTokenCallback;
//
diff --git a/doc/samples/SqlConnection_ConnectionString1.cs b/doc/samples/SqlConnection_ConnectionString1.cs
index 0b32e7ec71..2ffa037f78 100644
--- a/doc/samples/SqlConnection_ConnectionString1.cs
+++ b/doc/samples/SqlConnection_ConnectionString1.cs
@@ -1,3 +1,5 @@
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
namespace SqlConnection_ConnectionString1;
using System;
diff --git a/doc/samples/SqlDataAdapter_Concurrency.cs b/doc/samples/SqlDataAdapter_Concurrency.cs
index 0a69e4aad8..902cdf3f1c 100644
--- a/doc/samples/SqlDataAdapter_Concurrency.cs
+++ b/doc/samples/SqlDataAdapter_Concurrency.cs
@@ -1,3 +1,5 @@
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
namespace SqlDataAdapter_Concurrency;
//
diff --git a/doc/samples/SqlDataAdapter_Events.cs b/doc/samples/SqlDataAdapter_Events.cs
index 1c8188b046..5dc4fac3ef 100644
--- a/doc/samples/SqlDataAdapter_Events.cs
+++ b/doc/samples/SqlDataAdapter_Events.cs
@@ -1,4 +1,6 @@
-using System;
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
+using System;
using Microsoft.Data.SqlClient;
using System.Data;
diff --git a/doc/samples/SqlDataAdapter_FillDataSet.cs b/doc/samples/SqlDataAdapter_FillDataSet.cs
index 378b2d7e74..e6fd25dc34 100644
--- a/doc/samples/SqlDataAdapter_FillDataSet.cs
+++ b/doc/samples/SqlDataAdapter_FillDataSet.cs
@@ -1,4 +1,6 @@
-using System;
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
+using System;
using Microsoft.Data.SqlClient;
using System.Data;
diff --git a/doc/samples/SqlDataAdapter_MergeIdentity.cs b/doc/samples/SqlDataAdapter_MergeIdentity.cs
index aa0b2b6fa5..80dfa385ac 100644
--- a/doc/samples/SqlDataAdapter_MergeIdentity.cs
+++ b/doc/samples/SqlDataAdapter_MergeIdentity.cs
@@ -1,4 +1,6 @@
-namespace SqlDataAdapter_MergeIdentity;
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
+namespace SqlDataAdapter_MergeIdentity;
using System;
using System.Data;
diff --git a/doc/samples/SqlDataAdapter_Paging.cs b/doc/samples/SqlDataAdapter_Paging.cs
index c5f7a50322..a54895e915 100644
--- a/doc/samples/SqlDataAdapter_Paging.cs
+++ b/doc/samples/SqlDataAdapter_Paging.cs
@@ -1,4 +1,6 @@
-using System;
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
+using System;
using Microsoft.Data.SqlClient;
using System.Data;
diff --git a/doc/samples/SqlDataAdapter_Properties.cs b/doc/samples/SqlDataAdapter_Properties.cs
index aa59283844..66796d7abd 100644
--- a/doc/samples/SqlDataAdapter_Properties.cs
+++ b/doc/samples/SqlDataAdapter_Properties.cs
@@ -1,4 +1,6 @@
-namespace SqlDataAdapter_Properties;
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
+namespace SqlDataAdapter_Properties;
//
using System;
diff --git a/doc/samples/SqlDataAdapter_RowUpdated.cs b/doc/samples/SqlDataAdapter_RowUpdated.cs
index bcd44fb46a..ab3bad5287 100644
--- a/doc/samples/SqlDataAdapter_RowUpdated.cs
+++ b/doc/samples/SqlDataAdapter_RowUpdated.cs
@@ -1,3 +1,5 @@
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
#if NETFRAMEWORK
namespace SqlDataAdapter_RowUpdated;
@@ -11,8 +13,10 @@ namespace SqlDataAdapter_RowUpdated;
public class Form1 : Form
{
+#pragma warning disable CS0169 // Field is never used
private DataSet DataSet1;
private DataGrid dataGrid1;
+#pragma warning restore CS0169
// handler for RowUpdating event
private static void OnRowUpdating(object sender, SqlRowUpdatingEventArgs e)
diff --git a/doc/samples/SqlDataAdapter_SelectCommand.cs b/doc/samples/SqlDataAdapter_SelectCommand.cs
index b55809494e..1646b4869d 100644
--- a/doc/samples/SqlDataAdapter_SelectCommand.cs
+++ b/doc/samples/SqlDataAdapter_SelectCommand.cs
@@ -1,3 +1,5 @@
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
#if NETFRAMEWORK
namespace SqlDataAdapter_SelectCommand;
diff --git a/doc/samples/SqlDataAdapter_Update.cs b/doc/samples/SqlDataAdapter_Update.cs
index 3dfad3708f..4380378102 100644
--- a/doc/samples/SqlDataAdapter_Update.cs
+++ b/doc/samples/SqlDataAdapter_Update.cs
@@ -1,4 +1,6 @@
-namespace SqlDataAdapterUpdateExample;
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
+namespace SqlDataAdapterUpdateExample;
using System;
using System.Data;
diff --git a/doc/samples/SqlParameterCollection_Add6.cs b/doc/samples/SqlParameterCollection_Add6.cs
index 76d134b9ad..c12827d01f 100644
--- a/doc/samples/SqlParameterCollection_Add6.cs
+++ b/doc/samples/SqlParameterCollection_Add6.cs
@@ -1,3 +1,5 @@
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
#if NETFRAMEWORK
namespace SqlParameterCollection_Add6;
diff --git a/doc/samples/SqlParameterCollection_Count.cs b/doc/samples/SqlParameterCollection_Count.cs
index 8d7e1d54f6..361ba08e77 100644
--- a/doc/samples/SqlParameterCollection_Count.cs
+++ b/doc/samples/SqlParameterCollection_Count.cs
@@ -1,3 +1,5 @@
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
namespace SqlParameterCollection_Count;
using System;
diff --git a/doc/samples/SqlParameterCollection_Remove.cs b/doc/samples/SqlParameterCollection_Remove.cs
index 57c123a444..1fb9cbf4d3 100644
--- a/doc/samples/SqlParameterCollection_Remove.cs
+++ b/doc/samples/SqlParameterCollection_Remove.cs
@@ -1,3 +1,5 @@
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
#if NETFRAMEWORK
namespace SqlParameterCollection_Remove;
diff --git a/doc/samples/SqlParameter_Value.cs b/doc/samples/SqlParameter_Value.cs
index 6cac425d4d..3517822642 100644
--- a/doc/samples/SqlParameter_Value.cs
+++ b/doc/samples/SqlParameter_Value.cs
@@ -1,3 +1,5 @@
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
namespace SqlParameter_Value;
using System;
diff --git a/doc/samples/SqlRowUpdatingEventArgs.cs b/doc/samples/SqlRowUpdatingEventArgs.cs
index f0d533631a..c4e73f26e2 100644
--- a/doc/samples/SqlRowUpdatingEventArgs.cs
+++ b/doc/samples/SqlRowUpdatingEventArgs.cs
@@ -1,3 +1,5 @@
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
#if NETFRAMEWORK
namespace SqlRowUpdatingEventArgsCS;
@@ -11,8 +13,10 @@ namespace SqlRowUpdatingEventArgsCS;
public class Form1 : Form
{
+#pragma warning disable CS0169 // Field is never used
private DataSet DataSet1;
private DataGrid dataGrid1;
+#pragma warning restore CS0169
// handler for RowUpdating event
diff --git a/doc/samples/SqlUserDefinedType1.cs b/doc/samples/SqlUserDefinedType1.cs
index 06cb959016..92a1d65156 100644
--- a/doc/samples/SqlUserDefinedType1.cs
+++ b/doc/samples/SqlUserDefinedType1.cs
@@ -1,3 +1,5 @@
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
namespace SqlUserDefinedType1;
//-----------------------------------------------------------------------------
diff --git a/doc/samples/SspiContextProvider_CustomProvider.cs b/doc/samples/SspiContextProvider_CustomProvider.cs
index 1cacd414ea..09f99d93a3 100644
--- a/doc/samples/SspiContextProvider_CustomProvider.cs
+++ b/doc/samples/SspiContextProvider_CustomProvider.cs
@@ -1,4 +1,5 @@
//
+#if NET
using System;
using System.Buffers;
using System.Net.Security;
@@ -52,4 +53,5 @@ static void Main()
Console.WriteLine("Connected successfully with custom SSPI provider.");
}
}
+#endif
//
diff --git a/doc/samples/TransactionIsolationLevels.cs b/doc/samples/TransactionIsolationLevels.cs
index 818a3086a5..0b41be6c63 100644
--- a/doc/samples/TransactionIsolationLevels.cs
+++ b/doc/samples/TransactionIsolationLevels.cs
@@ -1,4 +1,6 @@
-using System;
+// TODO: Remove #nullable disable and fix nullable warnings in this sample.
+#nullable disable
+using System;
using System.Data;
//
using Microsoft.Data.SqlClient;
From 35536800fb9799c45ee657ec2fe02b4c513b4e26 Mon Sep 17 00:00:00 2001
From: Paul Medynski <31868385+paulmedynski@users.noreply.github.com>
Date: Fri, 13 Mar 2026 08:05:27 -0300
Subject: [PATCH 03/10] - Added analyzer config for unused usings. - Configured
the samples project to build via the sln.
---
.editorconfig | 3 +++
src/Microsoft.Data.SqlClient.sln | 18 ++++++++++++------
2 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/.editorconfig b/.editorconfig
index a4c0e063ea..819a41fe1e 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -178,6 +178,9 @@ csharp_space_between_square_brackets = false
# Analyzers
+# IDE0005: Remove unnecessary using directives
+dotnet_diagnostic.IDE0005.severity = suggestion
+
dotnet_code_quality.ca1802.api_surface = private, internal
# CA2000: Dispose objects before losing scope
diff --git a/src/Microsoft.Data.SqlClient.sln b/src/Microsoft.Data.SqlClient.sln
index a82d9f616c..44279d9de9 100644
--- a/src/Microsoft.Data.SqlClient.sln
+++ b/src/Microsoft.Data.SqlClient.sln
@@ -699,12 +699,18 @@ Global
{FAA1E517-581A-D3DC-BAC9-FAD1D5A5142C}.Release|x64.Build.0 = Release|Any CPU
{FAA1E517-581A-D3DC-BAC9-FAD1D5A5142C}.Release|x86.ActiveCfg = Release|Any CPU
{FAA1E517-581A-D3DC-BAC9-FAD1D5A5142C}.Release|x86.Build.0 = Release|Any CPU
- {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Debug|x64.ActiveCfg = Debug|x64
- {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Debug|x86.ActiveCfg = Debug|x86
- {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Release|x64.ActiveCfg = Release|x64
- {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Release|x86.ActiveCfg = Release|x86
+ {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Debug|x64.ActiveCfg = Debug|x64
+ {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Debug|x64.Build.0 = Debug|x64
+ {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Debug|x86.ActiveCfg = Debug|x86
+ {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Debug|x86.Build.0 = Debug|x86
+ {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Release|x64.ActiveCfg = Release|x64
+ {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Release|x64.Build.0 = Release|x64
+ {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Release|x86.ActiveCfg = Release|x86
+ {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Release|x86.Build.0 = Release|x86
{3FF03FA9-E3C3-49E3-9DCB-C703A5B0278B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3FF03FA9-E3C3-49E3-9DCB-C703A5B0278B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3FF03FA9-E3C3-49E3-9DCB-C703A5B0278B}.Debug|x64.ActiveCfg = Debug|x64
From 261b492956163c0825d6b2e1c017fe960b69d801 Mon Sep 17 00:00:00 2001
From: Paul Medynski <31868385+paulmedynski@users.noreply.github.com>
Date: Fri, 13 Mar 2026 08:24:49 -0300
Subject: [PATCH 04/10] - Moved all test PackageVersions into the tests/ props
file. - Removed nullable from samples to avoid unnecessary changes right now.
---
Directory.Packages.props | 10 --------
...tProvider_ColumnEncryptionKeyCacheScope.cs | 2 --
...StringSettings_RetrieveFromConfigByName.cs | 2 --
...ngSettings_RetrieveFromConfigByProvider.cs | 2 --
doc/samples/ConnectionStrings_Encrypt.cs | 2 --
...viceCodeFlowAzureAuthenticationProvider.cs | 2 --
doc/samples/IBinarySerialize.cs | 2 --
doc/samples/IDbCommand_CommandTimeout.cs | 2 --
doc/samples/Isolation_Snapshot1.cs | 2 --
.../Microsoft.Data.SqlClient.Samples.csproj | 7 +++---
.../DataWorks_IBinarySerialize_Sample.cs | 2 --
.../SqlUserDefinedTypeAttribute_Type1.cs | 2 --
doc/samples/SqlBytes_Stream.cs | 2 --
doc/samples/SqlClientDiagnosticCounter.cs | 2 --
doc/samples/SqlClientEventSource.cs | 2 --
.../SqlClientFactory_DataSourceEnumerator.cs | 2 --
...lient_AsyncProgramming_MultipleCommands.cs | 2 --
...ent_AsyncProgramming_MultipleCommandsEx.cs | 2 --
...lClient_AsyncProgramming_SqlTransaction.cs | 2 --
doc/samples/SqlCommandBuilder_Create.cs | 2 --
doc/samples/SqlCommand_Cancel.cs | 2 --
doc/samples/SqlCommand_CommandText.cs | 2 --
doc/samples/SqlCommand_SqlCommand1.cs | 2 --
...qlConfigurableRetryLogic_OpenConnection.cs | 2 --
.../SqlConfigurableRetryLogic_SqlCommand.cs | 2 --
.../SqlConnectionStringBuilder_TryGetValue.cs | 2 --
.../SqlConnection_AccessTokenCallback.cs | 2 --
.../SqlConnection_ConnectionString1.cs | 2 --
doc/samples/SqlDataAdapter_Concurrency.cs | 2 --
doc/samples/SqlDataAdapter_Events.cs | 2 --
doc/samples/SqlDataAdapter_FillDataSet.cs | 2 --
doc/samples/SqlDataAdapter_MergeIdentity.cs | 2 --
doc/samples/SqlDataAdapter_Paging.cs | 2 --
doc/samples/SqlDataAdapter_Properties.cs | 2 --
doc/samples/SqlDataAdapter_RowUpdated.cs | 2 --
doc/samples/SqlDataAdapter_SelectCommand.cs | 2 --
doc/samples/SqlDataAdapter_Update.cs | 2 --
doc/samples/SqlParameterCollection_Add6.cs | 2 --
doc/samples/SqlParameterCollection_Count.cs | 2 --
doc/samples/SqlParameterCollection_Remove.cs | 2 --
doc/samples/SqlParameter_Value.cs | 2 --
doc/samples/SqlRowUpdatingEventArgs.cs | 2 --
doc/samples/SqlUserDefinedType1.cs | 2 --
doc/samples/TransactionIsolationLevels.cs | 2 --
src/Microsoft.Data.SqlClient.sln | 24 +++++++++----------
.../tests/Directory.Packages.props | 13 ++++++++--
46 files changed, 27 insertions(+), 111 deletions(-)
diff --git a/Directory.Packages.props b/Directory.Packages.props
index f56055755e..ac0be63e88 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -121,14 +121,4 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/doc/samples/AzureKeyVaultProvider_ColumnEncryptionKeyCacheScope.cs b/doc/samples/AzureKeyVaultProvider_ColumnEncryptionKeyCacheScope.cs
index 21722bc5bc..b9be5306ca 100644
--- a/doc/samples/AzureKeyVaultProvider_ColumnEncryptionKeyCacheScope.cs
+++ b/doc/samples/AzureKeyVaultProvider_ColumnEncryptionKeyCacheScope.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
using System.Collections.Generic;
using Azure.Identity;
using Microsoft.Data.SqlClient;
diff --git a/doc/samples/ConnectionStringSettings_RetrieveFromConfigByName.cs b/doc/samples/ConnectionStringSettings_RetrieveFromConfigByName.cs
index 64c4d4d87c..466137f7af 100644
--- a/doc/samples/ConnectionStringSettings_RetrieveFromConfigByName.cs
+++ b/doc/samples/ConnectionStringSettings_RetrieveFromConfigByName.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
namespace ConnectionStringSettings_RetrieveFromConfigByName;
using System;
diff --git a/doc/samples/ConnectionStringSettings_RetrieveFromConfigByProvider.cs b/doc/samples/ConnectionStringSettings_RetrieveFromConfigByProvider.cs
index 0627b20902..881d58d658 100644
--- a/doc/samples/ConnectionStringSettings_RetrieveFromConfigByProvider.cs
+++ b/doc/samples/ConnectionStringSettings_RetrieveFromConfigByProvider.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
namespace ConnectionStringSettings_RetrieveFromConfigByProvider;
using System;
diff --git a/doc/samples/ConnectionStrings_Encrypt.cs b/doc/samples/ConnectionStrings_Encrypt.cs
index ba050d65d1..858cd71c82 100644
--- a/doc/samples/ConnectionStrings_Encrypt.cs
+++ b/doc/samples/ConnectionStrings_Encrypt.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
namespace ConnectionStrings_Encrypt;
using System;
diff --git a/doc/samples/CustomDeviceCodeFlowAzureAuthenticationProvider.cs b/doc/samples/CustomDeviceCodeFlowAzureAuthenticationProvider.cs
index defdfe6055..c3ae174c1c 100644
--- a/doc/samples/CustomDeviceCodeFlowAzureAuthenticationProvider.cs
+++ b/doc/samples/CustomDeviceCodeFlowAzureAuthenticationProvider.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
//
using System;
using System.Collections.Generic;
diff --git a/doc/samples/IBinarySerialize.cs b/doc/samples/IBinarySerialize.cs
index b71e17adb0..5e73c47de8 100644
--- a/doc/samples/IBinarySerialize.cs
+++ b/doc/samples/IBinarySerialize.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
using System;
using System.IO;
using System.Data;
diff --git a/doc/samples/IDbCommand_CommandTimeout.cs b/doc/samples/IDbCommand_CommandTimeout.cs
index e20660979f..b4118bac9e 100644
--- a/doc/samples/IDbCommand_CommandTimeout.cs
+++ b/doc/samples/IDbCommand_CommandTimeout.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
#if NETFRAMEWORK
namespace IDbCommand_CommandTimeout;
diff --git a/doc/samples/Isolation_Snapshot1.cs b/doc/samples/Isolation_Snapshot1.cs
index 4e16fcfa75..5be53b51fa 100644
--- a/doc/samples/Isolation_Snapshot1.cs
+++ b/doc/samples/Isolation_Snapshot1.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
namespace Isolation_Snapshot1;
using System;
diff --git a/doc/samples/Microsoft.Data.SqlClient.Samples.csproj b/doc/samples/Microsoft.Data.SqlClient.Samples.csproj
index b95a33b551..c194fac4d0 100644
--- a/doc/samples/Microsoft.Data.SqlClient.Samples.csproj
+++ b/doc/samples/Microsoft.Data.SqlClient.Samples.csproj
@@ -4,11 +4,12 @@
net8.0;net462
Library
disable
- enable
+
+
Latest
False
-
+
@@ -27,5 +28,5 @@
-
+
diff --git a/doc/samples/Microsoft.SqlServer.Server/csharp/DataWorks_IBinarySerialize_Sample.cs b/doc/samples/Microsoft.SqlServer.Server/csharp/DataWorks_IBinarySerialize_Sample.cs
index add4425ae3..726d3b5f89 100644
--- a/doc/samples/Microsoft.SqlServer.Server/csharp/DataWorks_IBinarySerialize_Sample.cs
+++ b/doc/samples/Microsoft.SqlServer.Server/csharp/DataWorks_IBinarySerialize_Sample.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
using System;
using System.IO;
using Microsoft.SqlServer.Server;
diff --git a/doc/samples/Microsoft.SqlServer.Server/csharp/SqlUserDefinedTypeAttribute_Type1.cs b/doc/samples/Microsoft.SqlServer.Server/csharp/SqlUserDefinedTypeAttribute_Type1.cs
index 63c3d50141..16b0f53cf1 100644
--- a/doc/samples/Microsoft.SqlServer.Server/csharp/SqlUserDefinedTypeAttribute_Type1.cs
+++ b/doc/samples/Microsoft.SqlServer.Server/csharp/SqlUserDefinedTypeAttribute_Type1.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
namespace SqlUserDefinedTypeAttribute_Type1;
//-----------------------------------------------------------------------------
diff --git a/doc/samples/SqlBytes_Stream.cs b/doc/samples/SqlBytes_Stream.cs
index f78bcc186a..0f7532da9c 100644
--- a/doc/samples/SqlBytes_Stream.cs
+++ b/doc/samples/SqlBytes_Stream.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
#if NETFRAMEWORK
namespace SqlBytes_Stream;
diff --git a/doc/samples/SqlClientDiagnosticCounter.cs b/doc/samples/SqlClientDiagnosticCounter.cs
index 187b877a2f..d4b25a6acc 100644
--- a/doc/samples/SqlClientDiagnosticCounter.cs
+++ b/doc/samples/SqlClientDiagnosticCounter.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
namespace SqlClientDiagnosticCounter;
//
diff --git a/doc/samples/SqlClientEventSource.cs b/doc/samples/SqlClientEventSource.cs
index 09c0b97f64..81ff98ee93 100644
--- a/doc/samples/SqlClientEventSource.cs
+++ b/doc/samples/SqlClientEventSource.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
namespace SqlClientEventSource;
//
diff --git a/doc/samples/SqlClientFactory_DataSourceEnumerator.cs b/doc/samples/SqlClientFactory_DataSourceEnumerator.cs
index 2781aac91c..875a75446f 100644
--- a/doc/samples/SqlClientFactory_DataSourceEnumerator.cs
+++ b/doc/samples/SqlClientFactory_DataSourceEnumerator.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
namespace SqlClientFactory_DataSourceEnumerator;
//
diff --git a/doc/samples/SqlClient_AsyncProgramming_MultipleCommands.cs b/doc/samples/SqlClient_AsyncProgramming_MultipleCommands.cs
index 5fa366b65a..a2814ff5f0 100644
--- a/doc/samples/SqlClient_AsyncProgramming_MultipleCommands.cs
+++ b/doc/samples/SqlClient_AsyncProgramming_MultipleCommands.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
namespace SqlClient_AsyncProgramming_MultipleCommands;
using System;
diff --git a/doc/samples/SqlClient_AsyncProgramming_MultipleCommandsEx.cs b/doc/samples/SqlClient_AsyncProgramming_MultipleCommandsEx.cs
index b51f47f3b5..552e977e15 100644
--- a/doc/samples/SqlClient_AsyncProgramming_MultipleCommandsEx.cs
+++ b/doc/samples/SqlClient_AsyncProgramming_MultipleCommandsEx.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
namespace SqlClient_AsyncProgramming_MultipleCommandsEx;
using System;
diff --git a/doc/samples/SqlClient_AsyncProgramming_SqlTransaction.cs b/doc/samples/SqlClient_AsyncProgramming_SqlTransaction.cs
index a8aae79656..b9c94abaf6 100644
--- a/doc/samples/SqlClient_AsyncProgramming_SqlTransaction.cs
+++ b/doc/samples/SqlClient_AsyncProgramming_SqlTransaction.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
namespace SqlClient_AsyncProgramming_SqlTransaction;
using System;
diff --git a/doc/samples/SqlCommandBuilder_Create.cs b/doc/samples/SqlCommandBuilder_Create.cs
index 79a9543252..b21847b7f5 100644
--- a/doc/samples/SqlCommandBuilder_Create.cs
+++ b/doc/samples/SqlCommandBuilder_Create.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
using System;
using System.Data;
using Microsoft.Data.SqlClient;
diff --git a/doc/samples/SqlCommand_Cancel.cs b/doc/samples/SqlCommand_Cancel.cs
index 907e5a913d..bf8b163f61 100644
--- a/doc/samples/SqlCommand_Cancel.cs
+++ b/doc/samples/SqlCommand_Cancel.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
namespace SqlCommand_Cancel;
//
diff --git a/doc/samples/SqlCommand_CommandText.cs b/doc/samples/SqlCommand_CommandText.cs
index 1cc5c8d113..76e1ccbed7 100644
--- a/doc/samples/SqlCommand_CommandText.cs
+++ b/doc/samples/SqlCommand_CommandText.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
#if NETFRAMEWORK
namespace SqlCommand_CommandText;
diff --git a/doc/samples/SqlCommand_SqlCommand1.cs b/doc/samples/SqlCommand_SqlCommand1.cs
index 115d4e98a1..da4c1adcc1 100644
--- a/doc/samples/SqlCommand_SqlCommand1.cs
+++ b/doc/samples/SqlCommand_SqlCommand1.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
#if NETFRAMEWORK
namespace SqlCommand_SqlCommand1;
diff --git a/doc/samples/SqlConfigurableRetryLogic_OpenConnection.cs b/doc/samples/SqlConfigurableRetryLogic_OpenConnection.cs
index 33381c0b78..b31d4cfbb0 100644
--- a/doc/samples/SqlConfigurableRetryLogic_OpenConnection.cs
+++ b/doc/samples/SqlConfigurableRetryLogic_OpenConnection.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
namespace SqlConfigurableRetryLogic_OpenConnection;
using System;
diff --git a/doc/samples/SqlConfigurableRetryLogic_SqlCommand.cs b/doc/samples/SqlConfigurableRetryLogic_SqlCommand.cs
index ac8b11e435..63f7c70ebe 100644
--- a/doc/samples/SqlConfigurableRetryLogic_SqlCommand.cs
+++ b/doc/samples/SqlConfigurableRetryLogic_SqlCommand.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
namespace SqlConfigurableRetryLogic_SqlCommand;
using System;
diff --git a/doc/samples/SqlConnectionStringBuilder_TryGetValue.cs b/doc/samples/SqlConnectionStringBuilder_TryGetValue.cs
index 807a866279..257b50569e 100644
--- a/doc/samples/SqlConnectionStringBuilder_TryGetValue.cs
+++ b/doc/samples/SqlConnectionStringBuilder_TryGetValue.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
namespace SqlConnectionStringBuilder_TryGetValue;
using System;
diff --git a/doc/samples/SqlConnection_AccessTokenCallback.cs b/doc/samples/SqlConnection_AccessTokenCallback.cs
index 0f61f7fbaa..05dee19ccb 100644
--- a/doc/samples/SqlConnection_AccessTokenCallback.cs
+++ b/doc/samples/SqlConnection_AccessTokenCallback.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
namespace SqlConnection_AccessTokenCallback;
//
diff --git a/doc/samples/SqlConnection_ConnectionString1.cs b/doc/samples/SqlConnection_ConnectionString1.cs
index 2ffa037f78..0b32e7ec71 100644
--- a/doc/samples/SqlConnection_ConnectionString1.cs
+++ b/doc/samples/SqlConnection_ConnectionString1.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
namespace SqlConnection_ConnectionString1;
using System;
diff --git a/doc/samples/SqlDataAdapter_Concurrency.cs b/doc/samples/SqlDataAdapter_Concurrency.cs
index 902cdf3f1c..0a69e4aad8 100644
--- a/doc/samples/SqlDataAdapter_Concurrency.cs
+++ b/doc/samples/SqlDataAdapter_Concurrency.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
namespace SqlDataAdapter_Concurrency;
//
diff --git a/doc/samples/SqlDataAdapter_Events.cs b/doc/samples/SqlDataAdapter_Events.cs
index 5dc4fac3ef..447537e0a4 100644
--- a/doc/samples/SqlDataAdapter_Events.cs
+++ b/doc/samples/SqlDataAdapter_Events.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
using System;
using Microsoft.Data.SqlClient;
using System.Data;
diff --git a/doc/samples/SqlDataAdapter_FillDataSet.cs b/doc/samples/SqlDataAdapter_FillDataSet.cs
index e6fd25dc34..fb8c352a63 100644
--- a/doc/samples/SqlDataAdapter_FillDataSet.cs
+++ b/doc/samples/SqlDataAdapter_FillDataSet.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
using System;
using Microsoft.Data.SqlClient;
using System.Data;
diff --git a/doc/samples/SqlDataAdapter_MergeIdentity.cs b/doc/samples/SqlDataAdapter_MergeIdentity.cs
index 80dfa385ac..4d66198644 100644
--- a/doc/samples/SqlDataAdapter_MergeIdentity.cs
+++ b/doc/samples/SqlDataAdapter_MergeIdentity.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
namespace SqlDataAdapter_MergeIdentity;
using System;
diff --git a/doc/samples/SqlDataAdapter_Paging.cs b/doc/samples/SqlDataAdapter_Paging.cs
index a54895e915..484f827a71 100644
--- a/doc/samples/SqlDataAdapter_Paging.cs
+++ b/doc/samples/SqlDataAdapter_Paging.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
using System;
using Microsoft.Data.SqlClient;
using System.Data;
diff --git a/doc/samples/SqlDataAdapter_Properties.cs b/doc/samples/SqlDataAdapter_Properties.cs
index 66796d7abd..ac01b1817e 100644
--- a/doc/samples/SqlDataAdapter_Properties.cs
+++ b/doc/samples/SqlDataAdapter_Properties.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
namespace SqlDataAdapter_Properties;
//
diff --git a/doc/samples/SqlDataAdapter_RowUpdated.cs b/doc/samples/SqlDataAdapter_RowUpdated.cs
index ab3bad5287..9fbafc94a6 100644
--- a/doc/samples/SqlDataAdapter_RowUpdated.cs
+++ b/doc/samples/SqlDataAdapter_RowUpdated.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
#if NETFRAMEWORK
namespace SqlDataAdapter_RowUpdated;
diff --git a/doc/samples/SqlDataAdapter_SelectCommand.cs b/doc/samples/SqlDataAdapter_SelectCommand.cs
index 1646b4869d..b55809494e 100644
--- a/doc/samples/SqlDataAdapter_SelectCommand.cs
+++ b/doc/samples/SqlDataAdapter_SelectCommand.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
#if NETFRAMEWORK
namespace SqlDataAdapter_SelectCommand;
diff --git a/doc/samples/SqlDataAdapter_Update.cs b/doc/samples/SqlDataAdapter_Update.cs
index 4380378102..cde3f31cae 100644
--- a/doc/samples/SqlDataAdapter_Update.cs
+++ b/doc/samples/SqlDataAdapter_Update.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
namespace SqlDataAdapterUpdateExample;
using System;
diff --git a/doc/samples/SqlParameterCollection_Add6.cs b/doc/samples/SqlParameterCollection_Add6.cs
index c12827d01f..76d134b9ad 100644
--- a/doc/samples/SqlParameterCollection_Add6.cs
+++ b/doc/samples/SqlParameterCollection_Add6.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
#if NETFRAMEWORK
namespace SqlParameterCollection_Add6;
diff --git a/doc/samples/SqlParameterCollection_Count.cs b/doc/samples/SqlParameterCollection_Count.cs
index 361ba08e77..8d7e1d54f6 100644
--- a/doc/samples/SqlParameterCollection_Count.cs
+++ b/doc/samples/SqlParameterCollection_Count.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
namespace SqlParameterCollection_Count;
using System;
diff --git a/doc/samples/SqlParameterCollection_Remove.cs b/doc/samples/SqlParameterCollection_Remove.cs
index 1fb9cbf4d3..57c123a444 100644
--- a/doc/samples/SqlParameterCollection_Remove.cs
+++ b/doc/samples/SqlParameterCollection_Remove.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
#if NETFRAMEWORK
namespace SqlParameterCollection_Remove;
diff --git a/doc/samples/SqlParameter_Value.cs b/doc/samples/SqlParameter_Value.cs
index 3517822642..6cac425d4d 100644
--- a/doc/samples/SqlParameter_Value.cs
+++ b/doc/samples/SqlParameter_Value.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
namespace SqlParameter_Value;
using System;
diff --git a/doc/samples/SqlRowUpdatingEventArgs.cs b/doc/samples/SqlRowUpdatingEventArgs.cs
index c4e73f26e2..9279ac348c 100644
--- a/doc/samples/SqlRowUpdatingEventArgs.cs
+++ b/doc/samples/SqlRowUpdatingEventArgs.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
#if NETFRAMEWORK
namespace SqlRowUpdatingEventArgsCS;
diff --git a/doc/samples/SqlUserDefinedType1.cs b/doc/samples/SqlUserDefinedType1.cs
index 92a1d65156..06cb959016 100644
--- a/doc/samples/SqlUserDefinedType1.cs
+++ b/doc/samples/SqlUserDefinedType1.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
namespace SqlUserDefinedType1;
//-----------------------------------------------------------------------------
diff --git a/doc/samples/TransactionIsolationLevels.cs b/doc/samples/TransactionIsolationLevels.cs
index 0b41be6c63..985d9c2ad2 100644
--- a/doc/samples/TransactionIsolationLevels.cs
+++ b/doc/samples/TransactionIsolationLevels.cs
@@ -1,5 +1,3 @@
-// TODO: Remove #nullable disable and fix nullable warnings in this sample.
-#nullable disable
using System;
using System.Data;
//
diff --git a/src/Microsoft.Data.SqlClient.sln b/src/Microsoft.Data.SqlClient.sln
index 44279d9de9..8c8ab3c7f3 100644
--- a/src/Microsoft.Data.SqlClient.sln
+++ b/src/Microsoft.Data.SqlClient.sln
@@ -699,18 +699,18 @@ Global
{FAA1E517-581A-D3DC-BAC9-FAD1D5A5142C}.Release|x64.Build.0 = Release|Any CPU
{FAA1E517-581A-D3DC-BAC9-FAD1D5A5142C}.Release|x86.ActiveCfg = Release|Any CPU
{FAA1E517-581A-D3DC-BAC9-FAD1D5A5142C}.Release|x86.Build.0 = Release|Any CPU
- {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Debug|x64.ActiveCfg = Debug|x64
- {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Debug|x64.Build.0 = Debug|x64
- {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Debug|x86.ActiveCfg = Debug|x86
- {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Debug|x86.Build.0 = Debug|x86
- {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Release|Any CPU.Build.0 = Release|Any CPU
- {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Release|x64.ActiveCfg = Release|x64
- {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Release|x64.Build.0 = Release|x64
- {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Release|x86.ActiveCfg = Release|x86
- {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Release|x86.Build.0 = Release|x86
+ {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Debug|x64.ActiveCfg = Debug|x64
+ {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Debug|x64.Build.0 = Debug|x64
+ {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Debug|x86.ActiveCfg = Debug|x86
+ {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Debug|x86.Build.0 = Debug|x86
+ {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Release|x64.ActiveCfg = Release|x64
+ {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Release|x64.Build.0 = Release|x64
+ {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Release|x86.ActiveCfg = Release|x86
+ {C09B9D2F-E463-BEBD-34E4-E8F2C201A277}.Release|x86.Build.0 = Release|x86
{3FF03FA9-E3C3-49E3-9DCB-C703A5B0278B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3FF03FA9-E3C3-49E3-9DCB-C703A5B0278B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3FF03FA9-E3C3-49E3-9DCB-C703A5B0278B}.Debug|x64.ActiveCfg = Debug|x64
diff --git a/src/Microsoft.Data.SqlClient/tests/Directory.Packages.props b/src/Microsoft.Data.SqlClient/tests/Directory.Packages.props
index 8587e0736d..43713b96dc 100644
--- a/src/Microsoft.Data.SqlClient/tests/Directory.Packages.props
+++ b/src/Microsoft.Data.SqlClient/tests/Directory.Packages.props
@@ -1,7 +1,16 @@
-
+
+
+
+
+
+
+
+
+
+
@@ -14,7 +23,7 @@
-
+
From cb2d0e1c1ea6c0005922377b092130ca84cd2c0c Mon Sep 17 00:00:00 2001
From: Paul Medynski <31868385+paulmedynski@users.noreply.github.com>
Date: Fri, 13 Mar 2026 08:25:35 -0300
Subject: [PATCH 05/10] - Adding Extensions package versions props files.
---
.../Abstractions/test/Directory.Packages.props | 11 +++++++++++
.../Azure/test/Directory.Packages.props | 11 +++++++++++
2 files changed, 22 insertions(+)
create mode 100644 src/Microsoft.Data.SqlClient.Extensions/Abstractions/test/Directory.Packages.props
create mode 100644 src/Microsoft.Data.SqlClient.Extensions/Azure/test/Directory.Packages.props
diff --git a/src/Microsoft.Data.SqlClient.Extensions/Abstractions/test/Directory.Packages.props b/src/Microsoft.Data.SqlClient.Extensions/Abstractions/test/Directory.Packages.props
new file mode 100644
index 0000000000..4145484108
--- /dev/null
+++ b/src/Microsoft.Data.SqlClient.Extensions/Abstractions/test/Directory.Packages.props
@@ -0,0 +1,11 @@
+
+
+
+
diff --git a/src/Microsoft.Data.SqlClient.Extensions/Azure/test/Directory.Packages.props b/src/Microsoft.Data.SqlClient.Extensions/Azure/test/Directory.Packages.props
new file mode 100644
index 0000000000..4145484108
--- /dev/null
+++ b/src/Microsoft.Data.SqlClient.Extensions/Azure/test/Directory.Packages.props
@@ -0,0 +1,11 @@
+
+
+
+
From aa65be514a8b39f50617c0cef11bb7c06113d225 Mon Sep 17 00:00:00 2001
From: Paul Medynski <31868385+paulmedynski@users.noreply.github.com>
Date: Fri, 13 Mar 2026 08:37:16 -0300
Subject: [PATCH 06/10] Fixed file mode on devcontainer scripts.
---
.devcontainer/setup-sqlserver.sh | 0
.devcontainer/sqlserver-entrypoint.sh | 0
2 files changed, 0 insertions(+), 0 deletions(-)
mode change 100644 => 100755 .devcontainer/setup-sqlserver.sh
mode change 100644 => 100755 .devcontainer/sqlserver-entrypoint.sh
diff --git a/.devcontainer/setup-sqlserver.sh b/.devcontainer/setup-sqlserver.sh
old mode 100644
new mode 100755
diff --git a/.devcontainer/sqlserver-entrypoint.sh b/.devcontainer/sqlserver-entrypoint.sh
old mode 100644
new mode 100755
From 19d4a49a6850980cb1b9c9bf66ee0c5c0df8c468 Mon Sep 17 00:00:00 2001
From: Paul Medynski <31868385+paulmedynski@users.noreply.github.com>
Date: Fri, 13 Mar 2026 08:55:47 -0300
Subject: [PATCH 07/10] - Fixed the sln to use the correct "samples" directory
name. - Fixed implicit package ref errors for .NET Standard 2.0.
---
...Command_BeginExecuteReaderAsyncBehavior.cs | 39 ++++++++++---------
.../SspiContextProvider_CustomProvider.cs | 1 +
src/Microsoft.Data.SqlClient.sln | 2 +-
.../tests/Directory.Packages.props | 13 ++++---
4 files changed, 30 insertions(+), 25 deletions(-)
diff --git a/doc/samples/SqlCommand_BeginExecuteReaderAsyncBehavior.cs b/doc/samples/SqlCommand_BeginExecuteReaderAsyncBehavior.cs
index 2d67007a67..2423cc306f 100644
--- a/doc/samples/SqlCommand_BeginExecuteReaderAsyncBehavior.cs
+++ b/doc/samples/SqlCommand_BeginExecuteReaderAsyncBehavior.cs
@@ -1,4 +1,5 @@
#if NETFRAMEWORK
+#nullable enable
//
using System;
@@ -24,8 +25,8 @@ public Form1()
private void InitializeComponent() { }
- // Hook up the form's Load event handler (you can double-click on
- // the form's design surface in Visual Studio), and then add
+ // Hook up the form's Load event handler (you can double-click on
+ // the form's design surface in Visual Studio), and then add
// this code to the form's class:
// You need this delegate in order to fill the grid from
// a thread other than the form's thread. See the HandleCallback
@@ -36,7 +37,7 @@ private void InitializeComponent() { }
private delegate void DisplayStatusDelegate(string Text);
// This flag ensures that the user does not attempt
- // to restart the command or close the form while the
+ // to restart the command or close the form while the
// asynchronous command is executing.
private bool isExecuting;
@@ -71,7 +72,7 @@ private void FillGrid(SqlDataReader reader)
finally
{
// Closing the reader also closes the connection,
- // because this reader was created using the
+ // because this reader was created using the
// CommandBehavior.CloseConnection value.
if (reader != null)
{
@@ -92,32 +93,32 @@ private void HandleCallback(IAsyncResult result)
// You may not interact with the form and its contents
// from a different thread, and this callback procedure
// is all but guaranteed to be running from a different thread
- // than the form. Therefore you cannot simply call code that
+ // than the form. Therefore you cannot simply call code that
// fills the grid, like this:
// FillGrid(reader);
// Instead, you must call the procedure from the form's thread.
// One simple way to accomplish this is to call the Invoke
// method of the form, which calls the delegate you supply
- // from the form's thread.
+ // from the form's thread.
FillGridDelegate del = new FillGridDelegate(FillGrid);
this.Invoke(del, reader);
- // Do not close the reader here, because it is being used in
+ // Do not close the reader here, because it is being used in
// a separate thread. Instead, have the procedure you have
// called close the reader once it is done with it.
}
catch (Exception ex)
{
- // Because you are now running code in a separate thread,
+ // Because you are now running code in a separate thread,
// if you do not handle the exception here, none of your other
- // code catches the exception. Because there is none of
+ // code catches the exception. Because there is none of
// your code on the call stack in this thread, there is nothing
- // higher up the stack to catch the exception if you do not
- // handle it here. You can either log the exception or
- // invoke a delegate (as in the non-error case in this
+ // higher up the stack to catch the exception if you do not
+ // handle it here. You can either log the exception or
+ // invoke a delegate (as in the non-error case in this
// example) to display the error on the form. In no case
// can you simply display the error without executing a delegate
- // as in the try block here.
- // You can create the delegate instance as you
+ // as in the try block here.
+ // You can create the delegate instance as you
// invoke it, like this:
this.Invoke(new DisplayStatusDelegate(DisplayStatus), "Error: " +
ex.Message);
@@ -130,8 +131,8 @@ private void HandleCallback(IAsyncResult result)
private string GetConnectionString()
{
- // To avoid storing the connection string in your code,
- // you can retrieve it from a configuration file.
+ // To avoid storing the connection string in your code,
+ // you can retrieve it from a configuration file.
return "Data Source=(local);Integrated Security=true;" +
"Initial Catalog=AdventureWorks";
@@ -153,7 +154,7 @@ private void button1_Click(object sender, System.EventArgs e)
{
DisplayStatus("Connecting...");
connection = new SqlConnection(GetConnectionString());
- // To emulate a long-running query, wait for
+ // To emulate a long-running query, wait for
// a few seconds before retrieving the real data.
command = new SqlCommand("WAITFOR DELAY '0:0:5';" +
"SELECT ProductID, Name, ListPrice, Weight FROM Production.Product",
@@ -162,8 +163,8 @@ private void button1_Click(object sender, System.EventArgs e)
DisplayStatus("Executing...");
isExecuting = true;
- // Although it is not required that you pass the
- // SqlCommand object as the second parameter in the
+ // Although it is not required that you pass the
+ // SqlCommand object as the second parameter in the
// BeginExecuteReader call, doing so makes it easier
// to call EndExecuteReader in the callback procedure.
AsyncCallback callback = new AsyncCallback(HandleCallback);
diff --git a/doc/samples/SspiContextProvider_CustomProvider.cs b/doc/samples/SspiContextProvider_CustomProvider.cs
index 09f99d93a3..c93d3e0d3f 100644
--- a/doc/samples/SspiContextProvider_CustomProvider.cs
+++ b/doc/samples/SspiContextProvider_CustomProvider.cs
@@ -1,5 +1,6 @@
//
#if NET
+#nullable enable
using System;
using System.Buffers;
using System.Net.Security;
diff --git a/src/Microsoft.Data.SqlClient.sln b/src/Microsoft.Data.SqlClient.sln
index 8c8ab3c7f3..a676900ad0 100644
--- a/src/Microsoft.Data.SqlClient.sln
+++ b/src/Microsoft.Data.SqlClient.sln
@@ -328,7 +328,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SqlClient.Stress.Runner", "
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SqlClient.Stress.Tests", "Microsoft.Data.SqlClient\tests\StressTests\SqlClient.Stress.Tests\SqlClient.Stress.Tests.csproj", "{FAA1E517-581A-D3DC-BAC9-FAD1D5A5142C}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Data.SqlClient.Samples", "..\doc\Samples\Microsoft.Data.SqlClient.Samples.csproj", "{C09B9D2F-E463-BEBD-34E4-E8F2C201A277}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Data.SqlClient.Samples", "..\doc\samples\Microsoft.Data.SqlClient.Samples.csproj", "{C09B9D2F-E463-BEBD-34E4-E8F2C201A277}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Data.SqlClient.TestCommon", "Microsoft.Data.SqlClient\tests\Common\Microsoft.Data.SqlClient.TestCommon.csproj", "{3FF03FA9-E3C3-49E3-9DCB-C703A5B0278B}"
EndProject
diff --git a/src/Microsoft.Data.SqlClient/tests/Directory.Packages.props b/src/Microsoft.Data.SqlClient/tests/Directory.Packages.props
index 43713b96dc..6496d964c2 100644
--- a/src/Microsoft.Data.SqlClient/tests/Directory.Packages.props
+++ b/src/Microsoft.Data.SqlClient/tests/Directory.Packages.props
@@ -9,6 +9,14 @@
+
+
+
+
@@ -22,9 +30,4 @@
-
-
-
-
-
From 56491960d840afa10b620d4b777887fb48789839 Mon Sep 17 00:00:00 2001
From: Paul Medynski <31868385+paulmedynski@users.noreply.github.com>
Date: Fri, 13 Mar 2026 09:31:58 -0300
Subject: [PATCH 08/10] - Fixed some incorrect snippet tags. - Removed the
unnecessary Microsoft.NETFramework.ReferenceAssemblies references.
---
doc/samples/SqlBulkCopy_RowArray.cs | 2 +-
doc/samples/SqlFunctionAttribute.cs | 2 +-
doc/samples/SqlParameterCollection_AddWithValue.cs | 1 -
doc/samples/SspiContextProvider_CustomProvider.cs | 5 +++--
.../Common/Microsoft.Data.SqlClient.TestCommon.csproj | 3 ---
.../tests/Directory.Packages.props | 9 ---------
.../Microsoft.Data.SqlClient.ManualTests.csproj | 3 ---
.../UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj | 3 ---
8 files changed, 5 insertions(+), 23 deletions(-)
diff --git a/doc/samples/SqlBulkCopy_RowArray.cs b/doc/samples/SqlBulkCopy_RowArray.cs
index 838f5245af..5ee0c61bdf 100644
--- a/doc/samples/SqlBulkCopy_RowArray.cs
+++ b/doc/samples/SqlBulkCopy_RowArray.cs
@@ -119,4 +119,4 @@ private static string GetConnectionString()
"Initial Catalog=AdventureWorks;";
}
}
-//
+//
diff --git a/doc/samples/SqlFunctionAttribute.cs b/doc/samples/SqlFunctionAttribute.cs
index 83d9db28f7..c88697b0a9 100644
--- a/doc/samples/SqlFunctionAttribute.cs
+++ b/doc/samples/SqlFunctionAttribute.cs
@@ -24,4 +24,4 @@ public static IEnumerable GetFileDetails(string directoryPath)
}
}
-//
+//
diff --git a/doc/samples/SqlParameterCollection_AddWithValue.cs b/doc/samples/SqlParameterCollection_AddWithValue.cs
index 645125bae2..46a78cf77e 100644
--- a/doc/samples/SqlParameterCollection_AddWithValue.cs
+++ b/doc/samples/SqlParameterCollection_AddWithValue.cs
@@ -46,7 +46,6 @@ private static void UpdateDemographics(Int32 customerID,
}
}
}
- //
static private string GetConnectionString()
{
// To avoid storing the connection string in your code,
diff --git a/doc/samples/SspiContextProvider_CustomProvider.cs b/doc/samples/SspiContextProvider_CustomProvider.cs
index c93d3e0d3f..1c024ffdb6 100644
--- a/doc/samples/SspiContextProvider_CustomProvider.cs
+++ b/doc/samples/SspiContextProvider_CustomProvider.cs
@@ -1,6 +1,7 @@
-//
#if NET
+//
#nullable enable
+
using System;
using System.Buffers;
using System.Net.Security;
@@ -54,5 +55,5 @@ static void Main()
Console.WriteLine("Connected successfully with custom SSPI provider.");
}
}
-#endif
//
+#endif
diff --git a/src/Microsoft.Data.SqlClient/tests/Common/Microsoft.Data.SqlClient.TestCommon.csproj b/src/Microsoft.Data.SqlClient/tests/Common/Microsoft.Data.SqlClient.TestCommon.csproj
index eab4f0493c..562c60b3af 100644
--- a/src/Microsoft.Data.SqlClient/tests/Common/Microsoft.Data.SqlClient.TestCommon.csproj
+++ b/src/Microsoft.Data.SqlClient/tests/Common/Microsoft.Data.SqlClient.TestCommon.csproj
@@ -27,9 +27,6 @@
-
diff --git a/src/Microsoft.Data.SqlClient/tests/Directory.Packages.props b/src/Microsoft.Data.SqlClient/tests/Directory.Packages.props
index 6496d964c2..78ea36f1fa 100644
--- a/src/Microsoft.Data.SqlClient/tests/Directory.Packages.props
+++ b/src/Microsoft.Data.SqlClient/tests/Directory.Packages.props
@@ -9,15 +9,6 @@
-
-
-
-
-
diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj b/src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj
index b0f830084a..32cb62fa86 100644
--- a/src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj
+++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTests.csproj
@@ -408,9 +408,6 @@
-
diff --git a/src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj b/src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj
index 5dca2b6845..318b44a28d 100644
--- a/src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj
+++ b/src/Microsoft.Data.SqlClient/tests/UnitTests/Microsoft.Data.SqlClient.UnitTests.csproj
@@ -53,9 +53,6 @@
-
From e8276abb3ca219e0f3a9920c31f97e77c5892b4e Mon Sep 17 00:00:00 2001
From: Paul Medynski <31868385+paulmedynski@users.noreply.github.com>
Date: Fri, 13 Mar 2026 10:47:02 -0300
Subject: [PATCH 09/10] Updated SqlClient nuspec to match reality.
---
tools/specs/Microsoft.Data.SqlClient.nuspec | 36 ++++++++++-----------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/tools/specs/Microsoft.Data.SqlClient.nuspec b/tools/specs/Microsoft.Data.SqlClient.nuspec
index 9507357a00..346f46431f 100644
--- a/tools/specs/Microsoft.Data.SqlClient.nuspec
+++ b/tools/specs/Microsoft.Data.SqlClient.nuspec
@@ -41,16 +41,16 @@
-
-
+
+
-
+
-
-
-
+
+
+
@@ -58,23 +58,23 @@
-
-
+
+
-
+
-
-
-
+
+
+
-
-
+
+
@@ -82,13 +82,13 @@
-
-
+
+
-
-
+
+
From 470b1298d9aa05b16efc341f5536f4921a03b7e3 Mon Sep 17 00:00:00 2001
From: Paul Medynski <31868385+paulmedynski@users.noreply.github.com>
Date: Fri, 13 Mar 2026 11:22:11 -0300
Subject: [PATCH 10/10] Fixed Windows max path length problems (really?)
---
doc/Directory.Packages.props | 2 +-
...a.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.csproj | 6 ++++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/doc/Directory.Packages.props b/doc/Directory.Packages.props
index e67b8b08ab..2ead6c1757 100644
--- a/doc/Directory.Packages.props
+++ b/doc/Directory.Packages.props
@@ -2,7 +2,7 @@
-
+
diff --git a/src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.csproj b/src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.csproj
index 7d70902c4a..929db3ae5b 100644
--- a/src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.csproj
+++ b/src/Microsoft.Data.SqlClient/add-ons/AzureKeyVaultProvider/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider.csproj
@@ -32,8 +32,10 @@
- $(Artifacts)/obj/$(Configuration)/$(AssemblyName)
- $(Artifacts)/bin/$(Configuration)/$(AssemblyName)
+
+ $(Artifacts)/obj/$(Configuration)/AzureKeyVaultProvider
+ $(Artifacts)/bin/$(Configuration)/AzureKeyVaultProvider
true