Skip to content

Commit af118d7

Browse files
author
SqlClient Azure DevOps
committed
Merge in 'main' changes
2 parents 226b83e + 4778b87 commit af118d7

File tree

10 files changed

+82
-322
lines changed

10 files changed

+82
-322
lines changed
File renamed without changes.

doc/snippets/Microsoft.Data.SqlClient/SqlConnection.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ using (SqlConnection connection = new SqlConnection(connectionString))
5151
5252
5353
## Examples
54-
The following example creates a <xref:Microsoft.Data.SqlClient.SqlCommand> and a <xref:Microsoft.Data.SqlClient.SqlConnection>. The <xref:Microsoft.Data.SqlClient.SqlConnection> is opened and set as the <xref:Microsoft.Data.SqlClient.SqlCommand.Connection%2A> for the <xref:Microsoft.Data.SqlClient.SqlCommand>. The example then calls <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery%2A>. To accomplish this, the <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery%2A> is passed a connection string and a query string that is a Transact-SQL INSERT statement. The connection is closed automatically when the code exits the using block.
54+
The following example creates a <xref:Microsoft.Data.SqlClient.SqlCommand> and a <xref:Microsoft.Data.SqlClient.SqlConnection>. The <xref:Microsoft.Data.SqlClient.SqlConnection> is opened and set as the <xref:Microsoft.Data.SqlClient.SqlCommand.Connection%2A> for the <xref:Microsoft.Data.SqlClient.SqlCommand>. The example then calls <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery%2A>. To accomplish this, the <xref:Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery%2A> is passed a SqlConnection and a query string that is a Transact-SQL INSERT statement. The connection is closed automatically when the code exits the using block.
5555
5656
[!code-csharp[SqlCommand_ExecuteNonQuery Example#1](~/../sqlclient/doc/samples/SqlCommand_ExecuteNonQuery.cs#1)]
5757

src/Microsoft.Data.SqlClient/netcore/src/Common/src/Microsoft/Data/ProviderBase/DbReferenceCollection.cs

Lines changed: 0 additions & 263 deletions
This file was deleted.

src/Microsoft.Data.SqlClient/netcore/src/Microsoft.Data.SqlClient.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,9 @@
519519
<Compile Include="$(CommonSourceRoot)System\Diagnostics\CodeAnalysis.cs">
520520
<Link>Common\System\Diagnostics\CodeAnalysis.cs</Link>
521521
</Compile>
522+
<Compile Include="$(CommonSourceRoot)\Microsoft\Data\ProviderBase\DbReferenceCollection.cs">
523+
<Link>Microsoft\Data\ProviderBase\DbReferenceCollection.cs</Link>
524+
</Compile>
522525
</ItemGroup>
523526
<ItemGroup Condition="'$(TargetGroup)' == 'netstandard' OR '$(TargetGroup)' == 'netcoreapp' OR '$(IsUAPAssembly)' == 'true'">
524527
<Compile Include="Microsoft.Data.SqlClient.TypeForwards.cs" />
@@ -616,9 +619,6 @@
616619
<Compile Include="$(CommonPath)\Microsoft\Data\ProviderBase\DbConnectionInternal.cs">
617620
<Link>Common\Microsoft\Data\ProviderBase\DbConnectionInternal.cs</Link>
618621
</Compile>
619-
<Compile Include="$(CommonPath)\Microsoft\Data\ProviderBase\DbReferenceCollection.cs">
620-
<Link>Common\Microsoft\Data\ProviderBase\DbReferenceCollection.cs</Link>
621-
</Compile>
622622
<Compile Include="$(CommonPath)\System\NotImplemented.cs" />
623623
<Compile Include="Interop\SNINativeMethodWrapper.Common.cs" />
624624
<Compile Include="Microsoft\Data\Common\DbConnectionOptions.cs" />

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserHelperClasses.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -764,13 +764,14 @@ private static string ToFriendlyName(this SslProtocols protocol)
764764
{
765765
name = "TLS 1.0";
766766
}
767-
#pragma warning disable CS0618 // Type or member is obsolete: SSL is depricated
767+
// SSL 2.0 and 3.0 are only referenced to log a warning, not explicitly used for connections
768+
#pragma warning disable CS0618, CA5397
768769
else if ((protocol & SslProtocols.Ssl3) == SslProtocols.Ssl3)
769770
{
770771
name = "SSL 3.0";
771772
}
772773
else if ((protocol & SslProtocols.Ssl2) == SslProtocols.Ssl2)
773-
#pragma warning restore CS0618 // Type or member is obsolete: SSL is depricated
774+
#pragma warning restore CS0618, CA5397
774775
{
775776
name = "SSL 2.0";
776777
}
@@ -790,9 +791,10 @@ private static string ToFriendlyName(this SslProtocols protocol)
790791
public static string GetProtocolWarning(this SslProtocols protocol)
791792
{
792793
string message = string.Empty;
793-
#pragma warning disable CS0618 // Type or member is obsolete : SSL is depricated
794+
// SSL 2.0 and 3.0 are only referenced to log a warning, not explicitly used for connections
795+
#pragma warning disable CS0618, CA5397
794796
if ((protocol & (SslProtocols.Ssl2 | SslProtocols.Ssl3 | SslProtocols.Tls | SslProtocols.Tls11)) != SslProtocols.None)
795-
#pragma warning restore CS0618 // Type or member is obsolete : SSL is depricated
797+
#pragma warning restore CS0618, CA5397
796798
{
797799
message = StringsHelper.Format(Strings.SEC_ProtocolWarning, protocol.ToFriendlyName());
798800
}

src/Microsoft.Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/TdsParserStateObjectNative.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,13 +427,14 @@ internal override uint WaitForSSLHandShakeToComplete(out int protocolVersion)
427427
}
428428
else if (nativeProtocol.HasFlag(NativeProtocols.SP_PROT_SSL3_CLIENT) || nativeProtocol.HasFlag(NativeProtocols.SP_PROT_SSL3_SERVER))
429429
{
430-
#pragma warning disable CS0618 // Type or member is obsolete : SSL is depricated
430+
// SSL 2.0 and 3.0 are only referenced to log a warning, not explicitly used for connections
431+
#pragma warning disable CS0618, CA5397
431432
protocolVersion = (int)SslProtocols.Ssl3;
432433
}
433434
else if (nativeProtocol.HasFlag(NativeProtocols.SP_PROT_SSL2_CLIENT) || nativeProtocol.HasFlag(NativeProtocols.SP_PROT_SSL2_SERVER))
434435
{
435436
protocolVersion = (int)SslProtocols.Ssl2;
436-
#pragma warning restore CS0618 // Type or member is obsolete : SSL is depricated
437+
#pragma warning restore CS0618, CA5397
437438
}
438439
else //if (nativeProtocol.HasFlag(NativeProtocols.SP_PROT_NONE))
439440
{

src/Microsoft.Data.SqlClient/netfx/src/Microsoft.Data.SqlClient.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,9 @@
609609
<Compile Include="$(CommonSourceRoot)Resources\ResDescriptionAttribute.cs">
610610
<Link>Resources\ResDescriptionAttribute.cs</Link>
611611
</Compile>
612+
<Compile Include="$(CommonSourceRoot)\Microsoft\Data\ProviderBase\DbReferenceCollection.cs">
613+
<Link>Microsoft\Data\ProviderBase\DbReferenceCollection.cs</Link>
614+
</Compile>
612615
</ItemGroup>
613616
<ItemGroup>
614617
<Compile Include="Common\src\Microsoft\Data\Common\NameValuePermission.cs" />
@@ -630,7 +633,6 @@
630633
<Compile Include="Microsoft\Data\ProviderBase\DbConnectionPool.cs" />
631634
<Compile Include="Microsoft\Data\ProviderBase\DbConnectionPoolCounters.cs" />
632635
<Compile Include="Microsoft\Data\ProviderBase\DbConnectionPoolIdentity.cs" />
633-
<Compile Include="Microsoft\Data\ProviderBase\DbReferenceCollection.cs" />
634636
<Compile Include="Microsoft\Data\RelationshipConverter.cs" />
635637
<Compile Include="Microsoft\Data\SqlClient\AlwaysEncryptedKeyConverter.Cng.cs" />
636638
<Compile Include="Microsoft\Data\SqlClient\assemblycache.cs" />

0 commit comments

Comments
 (0)