@@ -259,6 +259,8 @@ internal EncryptionOptions EncryptionOptions
259
259
}
260
260
}
261
261
262
+ internal bool Is2005OrNewer => true;
263
+
262
264
internal bool Is2008OrNewer
263
265
{
264
266
get
@@ -1327,7 +1329,7 @@ internal void ThrowExceptionAndWarning(TdsParserStateObject stateObj, bool calle
1327
1329
// report exception to pending async operation
1328
1330
// before OnConnectionClosed overrides the exception
1329
1331
// due to connection close notification through references
1330
- var taskSource = stateObj._networkPacketTaskSource;
1332
+ TaskCompletionSource<object> taskSource = stateObj._networkPacketTaskSource;
1331
1333
if (taskSource != null)
1332
1334
{
1333
1335
taskSource.TrySetException(ADP.ExceptionWithStackTrace(exception));
@@ -1337,7 +1339,7 @@ internal void ThrowExceptionAndWarning(TdsParserStateObject stateObj, bool calle
1337
1339
if (asyncClose)
1338
1340
{
1339
1341
// Wait until we have the parser lock, then try to close
1340
- var connHandler = _connHandler;
1342
+ SqlInternalConnectionTds connHandler = _connHandler;
1341
1343
Action<Action> wrapCloseAction = closeAction =>
1342
1344
{
1343
1345
Task.Factory.StartNew(() =>
@@ -2607,7 +2609,7 @@ private bool TryProcessEnvChange(int tokenLength, TdsParserStateObject stateObj,
2607
2609
2608
2610
while (tokenLength > processedLength)
2609
2611
{
2610
- var env = new SqlEnvChange();
2612
+ SqlEnvChange env = new SqlEnvChange();
2611
2613
if (!stateObj.TryReadByte(out env._type))
2612
2614
{
2613
2615
return false;
@@ -3370,7 +3372,7 @@ private bool TryProcessDataClassification(TdsParserStateObject stateObj, out Sen
3370
3372
{
3371
3373
return false;
3372
3374
}
3373
- var labels = new List<Label>(numLabels);
3375
+ List<Label> labels = new List<Label>(numLabels);
3374
3376
for (ushort i = 0; i < numLabels; i++)
3375
3377
{
3376
3378
if (!TryReadSensitivityLabel(stateObj, out string label, out string id))
@@ -3385,7 +3387,7 @@ private bool TryProcessDataClassification(TdsParserStateObject stateObj, out Sen
3385
3387
{
3386
3388
return false;
3387
3389
}
3388
- var informationTypes = new List<InformationType>(numInformationTypes);
3390
+ List<InformationType> informationTypes = new List<InformationType>(numInformationTypes);
3389
3391
for (ushort i = 0; i < numInformationTypes; i++)
3390
3392
{
3391
3393
if (!TryReadSensitivityInformationType(stateObj, out string informationType, out string id))
@@ -3410,15 +3412,15 @@ private bool TryProcessDataClassification(TdsParserStateObject stateObj, out Sen
3410
3412
{
3411
3413
return false;
3412
3414
}
3413
- var columnSensitivities = new List<ColumnSensitivity>(numResultColumns);
3415
+ List<ColumnSensitivity> columnSensitivities = new List<ColumnSensitivity>(numResultColumns);
3414
3416
for (ushort columnNum = 0; columnNum < numResultColumns; columnNum++)
3415
3417
{
3416
3418
// get sensitivity properties for all the different sources which were used in generating the column output
3417
3419
if (!stateObj.TryReadUInt16(out ushort numSources))
3418
3420
{
3419
3421
return false;
3420
3422
}
3421
- var sensitivityProperties = new List<SensitivityProperty>(numSources);
3423
+ List<SensitivityProperty> sensitivityProperties = new List<SensitivityProperty>(numSources);
3422
3424
for (ushort sourceNum = 0; sourceNum < numSources; sourceNum++)
3423
3425
{
3424
3426
// get the label index and then lookup label to use for source
@@ -4429,7 +4431,7 @@ internal void DrainData(TdsParserStateObject stateObj)
4429
4431
SqlDataReader.SharedState sharedState = stateObj._readerState;
4430
4432
if (sharedState != null && sharedState._dataReady)
4431
4433
{
4432
- var metadata = stateObj._cleanupMetaData;
4434
+ _SqlMetaDataSet metadata = stateObj._cleanupMetaData;
4433
4435
if (stateObj._partialHeaderBytesRead > 0)
4434
4436
{
4435
4437
if (!stateObj.TryProcessHeader())
@@ -7473,12 +7475,12 @@ private Task WriteEncodingChar(string s, int numChars, int offset, Encoding enco
7473
7475
else
7474
7476
{
7475
7477
#if NETFRAMEWORK || NETSTANDARD2_0
7476
- var charData = s.ToCharArray(offset, numChars);
7477
- var byteData = encoding.GetBytes(charData, 0, numChars);
7478
+ char[] charData = s.ToCharArray(offset, numChars);
7479
+ byte[] byteData = encoding.GetBytes(charData, 0, numChars);
7478
7480
Debug.Assert(byteData != null, "no data from encoding");
7479
7481
return stateObj.WriteByteArray(byteData, byteData.Length, 0, canAccumulate);
7480
7482
#else
7481
- var byteData = encoding.GetBytes(s, offset, numChars);
7483
+ byte[] byteData = encoding.GetBytes(s, offset, numChars);
7482
7484
Debug.Assert(byteData != null, "no data from encoding");
7483
7485
return stateObj.WriteByteArray(byteData, byteData.Length, 0, canAccumulate);
7484
7486
#endif
@@ -9854,7 +9856,7 @@ private void WriteSmiParameter(SqlParameter param, int paramIndex, bool sendDefa
9854
9856
9855
9857
if (advancedTraceIsOn)
9856
9858
{
9857
- var sendDefaultValue = sendDefault ? 1 : 0;
9859
+ int sendDefaultValue = sendDefault ? 1 : 0;
9858
9860
SqlClientEventSource.Log.TryAdvancedTraceEvent("<sc.TdsParser.WriteSmiParameter|ADV> {0}, Sending parameter '{1}', default flag={2}, metadata:{3}", ObjectID, param.ParameterName, sendDefaultValue, metaData.TraceString(3));
9859
9861
}
9860
9862
0 commit comments