Skip to content

Commit d0c5c26

Browse files
Moved to Shared - SqlParameter (#1354)
1 parent 73aa0da commit d0c5c26

File tree

8 files changed

+140
-2474
lines changed

8 files changed

+140
-2474
lines changed

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,9 @@
430430
<Compile Include="..\..\src\Microsoft\Data\SqlClient\SqlObjectPool.cs">
431431
<Link>Microsoft\Data\SqlClient\SqlObjectPool.cs</Link>
432432
</Compile>
433+
<Compile Include="..\..\src\Microsoft\Data\SqlClient\SqlParameter.cs">
434+
<Link>Microsoft\Data\SqlClient\SqlParameter.cs</Link>
435+
</Compile>
433436
<Compile Include="..\..\src\Microsoft\Data\SqlClient\SqlParameterCollection.cs">
434437
<Link>Microsoft\Data\SqlClient\SqlParameterCollection.cs</Link>
435438
</Compile>
@@ -565,7 +568,7 @@
565568
<Compile Include="Microsoft\Data\SqlClient\SNI\SNIStreams.ValueTask.cs" />
566569
<Compile Include="Microsoft\Data\SqlClient\SNI\SslOverTdsStream.NetCoreApp.cs" />
567570
<Compile Include="Microsoft\Data\SqlClient\SqlAuthenticationProviderManager.NetCoreApp.cs" />
568-
<Compile Include="Microsoft\Data\SqlClient\SqlConnectionFactory.AssemblyLoadContext.cs" />
571+
<Compile Include="Microsoft\Data\SqlClient\SqlConnectionFactory.AssemblyLoadContext.cs" />
569572
<Compile Include="Microsoft\Data\SqlClient\SqlDelegatedTransaction.NetCoreApp.cs" />
570573
<Compile Include="Microsoft\Data\SqlClient\SqlDiagnosticListener.NetCoreApp.cs" />
571574
<Compile Include="Microsoft\Data\SqlClient\TdsParser.NetCoreApp.cs" />
@@ -642,7 +645,6 @@
642645
<Compile Include="Microsoft\Data\SqlClient\SqlDelegatedTransaction.cs" />
643646
<Compile Include="Microsoft\Data\SqlClient\SqlInternalConnection.cs" />
644647
<Compile Include="Microsoft\Data\SqlClient\SqlInternalConnectionTds.cs" />
645-
<Compile Include="Microsoft\Data\SqlClient\SqlParameter.cs" />
646648
<Compile Include="Microsoft\Data\SqlClient\SqlTransaction.cs" />
647649
<Compile Include="Microsoft\Data\SqlClient\SqlUtil.cs" />
648650
<Compile Include="Microsoft\Data\SqlClient\TdsParser.cs" />

src/Microsoft.Data.SqlClient/netcore/src/Resources/Strings.Designer.cs

+18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Microsoft.Data.SqlClient/netcore/src/Resources/Strings.resx

+6
Original file line numberDiff line numberDiff line change
@@ -1932,4 +1932,10 @@
19321932
<data name="SQL_ParameterDirectionInvalidForOptimizedBinding" xml:space="preserve">
19331933
<value>Parameter '{0}' cannot have Direction Output or InputOutput when EnableOptimizedParameterBinding is enabled on the parent command.</value>
19341934
</data>
1935+
<data name="DataCategory_Update" xml:space="preserve">
1936+
<value>Update</value>
1937+
</data>
1938+
<data name="DataCategory_Xml" xml:space="preserve">
1939+
<value>XML</value>
1940+
</data>
19351941
</root>

src/Microsoft.Data.SqlClient/netcore/src/Resources/StringsHelper.cs

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ internal class ResourceNames
7676
{
7777
internal const string DataCategory_Data = @"Data";
7878
internal const string DataCategory_Update = @"Update";
79+
internal const string DataCategory_Xml = @"XML";
7980
internal const string DbCommand_CommandTimeout = @"Time to wait for command to execute.";
8081
internal const string DbConnection_State = @"The ConnectionState indicating whether the connection is open or closed.";
8182
internal const string DataCategory_Fill = @"Fill";

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,9 @@
494494
<Compile Include="..\..\src\Microsoft\Data\SqlClient\SqlParameterCollection.cs">
495495
<Link>Microsoft\Data\SqlClient\SqlParameterCollection.cs</Link>
496496
</Compile>
497+
<Compile Include="..\..\src\Microsoft\Data\SqlClient\SqlParameter.cs">
498+
<Link>Microsoft\Data\SqlClient\SqlParameter.cs</Link>
499+
</Compile>
497500
<Compile Include="..\..\src\Microsoft\Data\SqlClient\SqlQueryMetadataCache.cs">
498501
<Link>Microsoft\Data\SqlClient\SqlQueryMetadataCache.cs</Link>
499502
</Compile>
@@ -627,7 +630,6 @@
627630
<Compile Include="Microsoft\Data\SqlClient\SqlInternalConnection.cs" />
628631
<Compile Include="Microsoft\Data\SqlClient\SqlInternalConnectionSmi.cs" />
629632
<Compile Include="Microsoft\Data\SqlClient\SqlInternalConnectionTds.cs" />
630-
<Compile Include="Microsoft\Data\SqlClient\SqlParameter.cs" />
631633
<Compile Include="Microsoft\Data\SqlClient\SqlSequentialStreamSmi.cs" />
632634
<Compile Include="Microsoft\Data\SqlClient\SqlSequentialTextReaderSmi.cs" />
633635
<Compile Include="Microsoft\Data\SqlClient\SqlTransaction.cs" />

src/Microsoft.Data.SqlClient/netfx/src/Microsoft/Data/SqlClient/SqlCommand.cs

+2-5
Original file line numberDiff line numberDiff line change
@@ -6528,7 +6528,6 @@ private void SetUpRPCParameters(_SqlRPC rpc, int startCount, bool inSchema, SqlP
65286528
int paramCount = GetParameterCount(parameters);
65296529
int j = startCount;
65306530
TdsParser parser = _activeConnection.Parser;
6531-
bool is2005OrNewer = parser.Is2005OrNewer;
65326531

65336532
for (ii = 0; ii < paramCount; ii++)
65346533
{
@@ -6537,7 +6536,7 @@ private void SetUpRPCParameters(_SqlRPC rpc, int startCount, bool inSchema, SqlP
65376536

65386537
// func will change type to that with a 4 byte length if the type has a two
65396538
// byte length and a parameter length > than that expressable in 2 bytes
6540-
if ((!parameter.ValidateTypeLengths(is2005OrNewer).IsPlp) && (parameter.Direction != ParameterDirection.Output))
6539+
if ((!parameter.ValidateTypeLengths().IsPlp) && (parameter.Direction != ParameterDirection.Output))
65416540
{
65426541
parameter.FixStreamDataForNonPLP();
65436542
}
@@ -6925,8 +6924,6 @@ internal string BuildParamList(TdsParser parser, SqlParameterCollection paramete
69256924
StringBuilder paramList = new StringBuilder();
69266925
bool fAddSeparator = false;
69276926

6928-
bool is2005OrNewer = parser.Is2005OrNewer;
6929-
69306927
int count = 0;
69316928

69326929
count = parameters.Count;
@@ -6976,7 +6973,7 @@ internal string BuildParamList(TdsParser parser, SqlParameterCollection paramete
69766973
{
69776974
// func will change type to that with a 4 byte length if the type has a two
69786975
// byte length and a parameter length > than that expressable in 2 bytes
6979-
mt = sqlParam.ValidateTypeLengths(is2005OrNewer);
6976+
mt = sqlParam.ValidateTypeLengths();
69806977
if ((!mt.IsPlp) && (sqlParam.Direction != ParameterDirection.Output))
69816978
{
69826979
sqlParam.FixStreamDataForNonPLP();

0 commit comments

Comments
 (0)