1402 references to TdsEnums
System.Data (1402)
fx\src\data\Microsoft\SqlServer\Server\MetadataUtilsSmi.cs (3)
547
if ((!ADP.IsEmpty(typeSpecificNamePart1) &&
TdsEnums
.MAX_SERVERNAME < typeSpecificNamePart1.Length)
548
|| (!ADP.IsEmpty(typeSpecificNamePart2) &&
TdsEnums
.MAX_SERVERNAME < typeSpecificNamePart2.Length)
549
|| (!ADP.IsEmpty(typeSpecificNamePart3) &&
TdsEnums
.MAX_SERVERNAME < typeSpecificNamePart3.Length)) {
fx\src\data\Microsoft\SqlServer\Server\SmiEventSink_Default.cs (2)
97
if (error.Class >=
TdsEnums
.FATAL_ERROR_CLASS){
239
if ( error.Class <
TdsEnums
.MIN_ERROR_CLASS ) {
fx\src\data\Microsoft\SqlServer\Server\ValueUtilsSmi.cs (5)
33
const int __maxByteChunkSize =
TdsEnums
.MAXSIZE;
34
const int __maxCharChunkSize =
TdsEnums
.MAXSIZE / sizeof(char);
2466
if (
TdsEnums
.SQL_SMALL_MONEY_MIN > decimalValue ||
TdsEnums
.SQL_SMALL_MONEY_MAX < decimalValue) {
2846
length = Math.Min( length,
TdsEnums
.TYPE_SIZE_LIMIT );
fx\src\data\System\Data\SqlClient\LocalDBAPI.cs (2)
235
collection.Add(new SqlError(errorCode, 0,
TdsEnums
.FATAL_ERROR_CLASS, instance, errorMessage, null, 0));
238
collection.Add(new SqlError(errorCode, 0,
TdsEnums
.FATAL_ERROR_CLASS, instance, GetLocalDBMessage(localDbError), null, 0));
fx\src\data\System\Data\SqlClient\SqlBuffer.cs (1)
941
timeInfo.ticks = tickUnits *
TdsEnums
.TICKS_FROM_SCALE[scale];
fx\src\data\System\Data\SqlClient\SqlBulkCopy.cs (60)
611
case
TdsEnums
.SQLNUMERICN:
612
case
TdsEnums
.SQLDECIMALN:
617
case
TdsEnums
.SQLUDT: {
626
case
TdsEnums
.SQLTIME:
627
case
TdsEnums
.SQLDATETIME2:
628
case
TdsEnums
.SQLDATETIMEOFFSET:
639
case
TdsEnums
.SQLNCHAR:
640
case
TdsEnums
.SQLNVARCHAR:
641
case
TdsEnums
.SQLNTEXT:
779
_stateObj._outputMessageType =
TdsEnums
.MT_BULK;
1069
if (((_SqlDataReaderRowSource != null) || (_dataTableSource != null)) && ((metadata.metaType.NullableType ==
TdsEnums
.SQLDECIMALN) || (metadata.metaType.NullableType ==
TdsEnums
.SQLNUMERICN))) {
1275
case
TdsEnums
.SQLFLT4:
1276
case
TdsEnums
.SQLFLT8:
1277
case
TdsEnums
.SQLINT8:
1278
case
TdsEnums
.SQLINT4:
1279
case
TdsEnums
.SQLINT2:
1280
case
TdsEnums
.SQLINT1:
1281
case
TdsEnums
.SQLBIT:
1282
case
TdsEnums
.SQLBIGVARBINARY:
1283
case
TdsEnums
.SQLBIGVARCHAR:
1284
case
TdsEnums
.SQLUNIQUEID:
1285
case
TdsEnums
.SQLNVARCHAR:
1286
case
TdsEnums
.SQLDATETIME:
1287
case
TdsEnums
.SQLMONEY:
1288
case
TdsEnums
.SQLNUMERICN:
1289
case
TdsEnums
.SQLDATE:
1290
case
TdsEnums
.SQLTIME:
1291
case
TdsEnums
.SQLDATETIME2:
1292
case
TdsEnums
.SQLDATETIMEOFFSET:
1334
case
TdsEnums
.SQLNUMERICN:
1335
case
TdsEnums
.SQLDECIMALN:
1380
case
TdsEnums
.SQLINTN:
1381
case
TdsEnums
.SQLFLTN:
1382
case
TdsEnums
.SQLFLT4:
1383
case
TdsEnums
.SQLFLT8:
1384
case
TdsEnums
.SQLMONEYN:
1385
case
TdsEnums
.SQLDATETIM4:
1386
case
TdsEnums
.SQLDATETIME:
1387
case
TdsEnums
.SQLDATETIMN:
1388
case
TdsEnums
.SQLBIT:
1389
case
TdsEnums
.SQLBITN:
1390
case
TdsEnums
.SQLUNIQUEID:
1391
case
TdsEnums
.SQLBIGBINARY:
1392
case
TdsEnums
.SQLBIGVARBINARY:
1393
case
TdsEnums
.SQLIMAGE:
1394
case
TdsEnums
.SQLBIGCHAR:
1395
case
TdsEnums
.SQLBIGVARCHAR:
1396
case
TdsEnums
.SQLTEXT:
1397
case
TdsEnums
.SQLDATE:
1398
case
TdsEnums
.SQLTIME:
1399
case
TdsEnums
.SQLDATETIME2:
1400
case
TdsEnums
.SQLDATETIMEOFFSET:
1404
case
TdsEnums
.SQLNCHAR:
1405
case
TdsEnums
.SQLNVARCHAR:
1406
case
TdsEnums
.SQLNTEXT:
1416
case
TdsEnums
.SQLVARIANT:
1420
case
TdsEnums
.SQLUDT:
1432
case
TdsEnums
.SQLXMLTYPE:
2172
_stateObj.WriteByte(
TdsEnums
.SQLROW);
fx\src\data\System\Data\SqlClient\SqlCachedBuffer.cs (1)
94
cachedBytes.Add(
TdsEnums
.XMLUNICODEBOMBYTES);
fx\src\data\System\Data\SqlClient\SqlCommand.cs (46)
2244
if ( (usedCache && (sqlEx.Errors[i].Number ==
TdsEnums
.TCE_CONVERSION_ERROR_CLIENT_RETRY) ) ||
2245
(ShouldUseEnclaveBasedWorkflow && (sqlEx.Errors[i].Number ==
TdsEnums
.TCE_ENCLAVE_INVALID_SESSION_HANDLE) ) ){
2762
cmdText.Append("[sys].[").Append(
TdsEnums
.SP_PARAMS_MGD10).Append("]");
2770
cmdText.Append("[sys].[").Append(
TdsEnums
.SP_PARAMS_MANAGED).Append("]");
2774
cmdText.Append(".[").Append(
TdsEnums
.SP_PARAMS).Append("]");
3696
SqlParameter sqlParam = new SqlParameter(null, ((queryText.Length << 1) <=
TdsEnums
.TYPE_SIZE_LIMIT) ? SqlDbType.NVarChar : SqlDbType.NText, queryText.Length);
3790
sqlParam = new SqlParameter(null, ((parameterList.Length << 1) <=
TdsEnums
.TYPE_SIZE_LIMIT) ? SqlDbType.NVarChar : SqlDbType.NText, parameterList.Length);
3897
if (this._activeConnection.Parser.TceVersionSupported >=
TdsEnums
.MIN_TCE_VERSION_WITH_ENCLAVE_SUPPORT) {
4018
rpc.paramoptions[paramIdx] |=
TdsEnums
.RPC_PARAM_ENCRYPTED;
4200
if ( (usedCache && (ex.Errors[i].Number ==
TdsEnums
.TCE_CONVERSION_ERROR_CLIENT_RETRY) ) ||
4201
(ShouldUseEnclaveBasedWorkflow && (ex.Errors[i].Number ==
TdsEnums
.TCE_ENCLAVE_INVALID_SESSION_HANDLE) ) ) {
4493
rpc.options =
TdsEnums
.RPC_NOMETADATA;
5167
if(rec.tdsType !=
TdsEnums
.SQLBIGVARBINARY) {
5168
throw SQL.InvalidDataTypeForEncryptedParameter(thisParam.ParameterNameFixed, rec.tdsType,
TdsEnums
.SQLBIGVARBINARY);
5439
rpc.paramoptions[j] =
TdsEnums
.RPC_PARAM_BYREF;
5443
rpc.paramoptions[j] |=
TdsEnums
.RPC_PARAM_ENCRYPTED;
5454
rpc.paramoptions[j] |=
TdsEnums
.RPC_PARAM_DEFAULT;
5480
rpc.ProcID =
TdsEnums
.RPC_PROCID_PREPEXEC;
5481
rpc.rpcName =
TdsEnums
.SP_PREPEXEC;
5488
rpc.paramoptions[0] =
TdsEnums
.RPC_PARAM_BYREF;
5492
sqlParam = new SqlParameter(null, ((paramList.Length<<1)<=
TdsEnums
.TYPE_SIZE_LIMIT)?SqlDbType.NVarChar:SqlDbType.NText, paramList.Length);
5498
sqlParam = new SqlParameter(null, ((text.Length<<1)<=
TdsEnums
.TYPE_SIZE_LIMIT)?SqlDbType.NVarChar:SqlDbType.NText, text.Length);
5572
rpc.ProcID =
TdsEnums
.RPC_PROCID_UNPREPARE;
5573
rpc.rpcName =
TdsEnums
.SP_UNPREPARE;
5600
rpc.ProcID =
TdsEnums
.RPC_PROCID_EXECUTE;
5601
rpc.rpcName =
TdsEnums
.SP_EXECUTE;
5633
rpc.ProcID =
TdsEnums
.RPC_PROCID_EXECUTESQL;
5634
rpc.rpcName =
TdsEnums
.SP_EXECUTESQL;
5640
sqlParam = new SqlParameter(null, ((commandText.Length<<1)<=
TdsEnums
.TYPE_SIZE_LIMIT)?SqlDbType.NVarChar:SqlDbType.NText, commandText.Length);
5646
sqlParam = new SqlParameter(null, ((paramList.Length<<1)<=
TdsEnums
.TYPE_SIZE_LIMIT)?SqlDbType.NVarChar:SqlDbType.NText, paramList.Length);
5732
SqlParameter tsqlParameter = new SqlParameter(null, ((execStatement.Length << 1) <=
TdsEnums
.TYPE_SIZE_LIMIT) ? SqlDbType.NVarChar : SqlDbType.NText, execStatement.Length);
5806
precision =
TdsEnums
.DEFAULT_NUMERIC_PRECISION;
5808
precision =
TdsEnums
.SPHINX_DEFAULT_NUMERIC_PRECISION;
5856
size = mt.IsSizeInCharacters ? (
TdsEnums
.MAXSIZE >> 1) :
TdsEnums
.MAXSIZE;
5867
paramList.Append(" " +
TdsEnums
.PARAM_OUTPUT);
5908
s =
TdsEnums
.FMTONLY_OFF;
5911
s = s +
TdsEnums
.BROWSE_ON;
5915
s = s +
TdsEnums
.FMTONLY_ON;
5927
s = s +
TdsEnums
.FMTONLY_OFF;
5932
s = s +
TdsEnums
.BROWSE_OFF;
5957
rpc.ProcID =
TdsEnums
.RPC_PROCID_PREPARE;
5958
rpc.rpcName =
TdsEnums
.SP_PREPARE;
5964
rpc.paramoptions[0] =
TdsEnums
.RPC_PARAM_BYREF;
5968
sqlParam = new SqlParameter(null, ((paramList.Length<<1)<=
TdsEnums
.TYPE_SIZE_LIMIT)?SqlDbType.NVarChar:SqlDbType.NText, paramList.Length);
5974
sqlParam = new SqlParameter(null, ((text.Length<<1)<=
TdsEnums
.TYPE_SIZE_LIMIT)?SqlDbType.NVarChar:SqlDbType.NText, text.Length);
fx\src\data\System\Data\SqlClient\SqlConnection.cs (25)
1760
if (exception.Class >=
TdsEnums
.MIN_ERROR_CLASS) {
1882
mapFileName = "Global\\" +
TdsEnums
.SDCI_MAPFILENAME;
1885
mapFileName =
TdsEnums
.SDCI_MAPFILENAME;
1945
IssueSQLDebug(
TdsEnums
.SQLDEBUG_ON, sdc.machineName, sdc.pid, sdc.dbgpid, sdc.sdiDllName, sdc.data);
1961
IssueSQLDebug(
TdsEnums
.SQLDEBUG_OFF, null, 0, 0, null, null);
1968
IssueSQLDebug(
TdsEnums
.SQLDEBUG_CONTEXT, null, sdc.pid, sdc.tid, null, null);
1988
SqlCommand c = new SqlCommand(
TdsEnums
.SP_SDIDEBUG, this);
1992
SqlParameter p = new SqlParameter(null, SqlDbType.VarChar,
TdsEnums
.SQLDEBUG_MODE_NAMES[option].Length);
1993
p.Value =
TdsEnums
.SQLDEBUG_MODE_NAMES[option];
1996
if (option ==
TdsEnums
.SQLDEBUG_ON) {
2007
if (option !=
TdsEnums
.SQLDEBUG_OFF) {
2018
if (option ==
TdsEnums
.SQLDEBUG_ON) {
2040
if (
TdsEnums
.MAXLEN_NEWPASSWORD < newPassword.Length) {
2041
throw ADP.InvalidArgumentLength("newPassword",
TdsEnums
.MAXLEN_NEWPASSWORD);
2090
if (
TdsEnums
.MAXLEN_NEWPASSWORD < newSecurePassword.Length) {
2091
throw ADP.InvalidArgumentLength("newSecurePassword",
TdsEnums
.MAXLEN_NEWPASSWORD);
2156
Encoding cp = System.Text.Encoding.GetEncoding(
TdsEnums
.DEFAULT_ENGLISH_CODE_PAGE_VALUE);
2450
if (pszMachineName.Length >
TdsEnums
.SDCI_MAX_MACHINENAME ||
2451
pszSDIDLLName.Length >
TdsEnums
.SDCI_MAX_DLLNAME)
2455
Encoding cp = System.Text.Encoding.GetEncoding(
TdsEnums
.DEFAULT_ENGLISH_CODE_PAGE_VALUE);
2459
if (null != rgbData && cbData >
TdsEnums
.SDCI_MAX_DATA)
2466
mapFileName = "Global\\" +
TdsEnums
.SDCI_MAPFILENAME;
2469
mapFileName =
TdsEnums
.SDCI_MAPFILENAME;
2516
offset +=
TdsEnums
.SDCI_MAX_MACHINENAME;
2518
offset +=
TdsEnums
.SDCI_MAX_DLLNAME;
fx\src\data\System\Data\SqlClient\SqlConnectionString.cs (27)
30
internal const string Application_Name =
TdsEnums
.SQL_PROVIDER_NAME;
348
if ((_packetSize <
TdsEnums
.MIN_PACKET_SIZE) || (
TdsEnums
.MAX_PACKET_SIZE < _packetSize)) {
364
ValidateValueLength(_applicationName,
TdsEnums
.MAXLEN_APPNAME, KEY.Application_Name);
365
ValidateValueLength(_currentLanguage ,
TdsEnums
.MAXLEN_LANGUAGE, KEY.Current_Language);
366
ValidateValueLength(_dataSource,
TdsEnums
.MAXLEN_SERVERNAME, KEY.Data_Source);
367
ValidateValueLength(_failoverPartner,
TdsEnums
.MAXLEN_SERVERNAME, KEY.FailoverPartner);
368
ValidateValueLength(_initialCatalog,
TdsEnums
.MAXLEN_DATABASE, KEY.Initial_Catalog);
369
ValidateValueLength(_password,
TdsEnums
.MAXLEN_PASSWORD, KEY.Password);
370
ValidateValueLength(_userID,
TdsEnums
.MAXLEN_USERNAME, KEY.User_ID);
372
ValidateValueLength(_workstationId,
TdsEnums
.MAXLEN_HOSTNAME, KEY.Workstation_Id);
394
ValidateValueLength(_expandedAttachDBFilename,
TdsEnums
.MAXLEN_ATTACHDBFILE, KEY.AttachDBFilename);
409
ValidateValueLength(_attachDBFileName,
TdsEnums
.MAXLEN_ATTACHDBFILE, KEY.AttachDBFilename);
534
ValidateValueLength(_dataSource,
TdsEnums
.MAXLEN_SERVERNAME, KEY.Data_Source);
713
ValidateValueLength(result,
TdsEnums
.MAXLEN_HOSTNAME, KEY.Workstation_Id);
724
hash.Add(NETLIB.TCPIP,
TdsEnums
.TCP);
725
hash.Add(NETLIB.NamedPipes,
TdsEnums
.NP);
726
hash.Add(NETLIB.Multiprotocol,
TdsEnums
.RPC);
727
hash.Add(NETLIB.BanyanVines,
TdsEnums
.BV);
728
hash.Add(NETLIB.AppleTalk,
TdsEnums
.ADSP);
729
hash.Add(NETLIB.IPXSPX,
TdsEnums
.SPX);
730
hash.Add(NETLIB.VIA,
TdsEnums
.VIA);
731
hash.Add(NETLIB.SharedMemory,
TdsEnums
.LPC);
740
case
TdsEnums
.TCP :
741
case
TdsEnums
.NP :
742
case
TdsEnums
.VIA :
743
case
TdsEnums
.LPC :
fx\src\data\System\Data\SqlClient\SqlConnectionStringBuilder.cs (2)
754
if ((value <
TdsEnums
.MIN_PACKET_SIZE) || (
TdsEnums
.MAX_PACKET_SIZE < value)) {
fx\src\data\System\Data\SqlClient\SqlCredential.cs (4)
38
if (userId.Length >
TdsEnums
.MAXLEN_USERNAME)
40
throw ADP.InvalidArgumentLength("userId",
TdsEnums
.MAXLEN_USERNAME);
48
if (password.Length >
TdsEnums
.MAXLEN_PASSWORD)
50
throw ADP.InvalidArgumentLength("password",
TdsEnums
.MAXLEN_PASSWORD);
fx\src\data\System\Data\SqlClient\SqlDataReader.cs (41)
308
if ( length >
TdsEnums
.MAXSIZE ) {
536
schemaRow[Size] =
TdsEnums
.WHIDBEY_DATE_LENGTH;
539
Debug.Assert(
TdsEnums
.UNKNOWN_PRECISION_SCALE == col.scale || (0 <= col.scale && col.scale <= 7), "Invalid scale for Time column: " + col.scale);
540
schemaRow[Size] =
TdsEnums
.WHIDBEY_TIME_LENGTH[
TdsEnums
.UNKNOWN_PRECISION_SCALE != col.scale ? col.scale : col.metaType.Scale];
543
Debug.Assert(
TdsEnums
.UNKNOWN_PRECISION_SCALE == col.scale || (0 <= col.scale && col.scale <= 7), "Invalid scale for DateTime2 column: " + col.scale);
544
schemaRow[Size] =
TdsEnums
.WHIDBEY_DATETIME2_LENGTH[
TdsEnums
.UNKNOWN_PRECISION_SCALE != col.scale ? col.scale : col.metaType.Scale];
547
Debug.Assert(
TdsEnums
.UNKNOWN_PRECISION_SCALE == col.scale || (0 <= col.scale && col.scale <= 7), "Invalid scale for DateTimeOffset column: " + col.scale);
548
schemaRow[Size] =
TdsEnums
.WHIDBEY_DATETIMEOFFSET_LENGTH[
TdsEnums
.UNKNOWN_PRECISION_SCALE != col.scale ? col.scale : col.metaType.Scale];
587
if (
TdsEnums
.UNKNOWN_PRECISION_SCALE != col.baseTI.precision) {
594
else if (
TdsEnums
.UNKNOWN_PRECISION_SCALE != col.precision) {
606
if (
TdsEnums
.UNKNOWN_PRECISION_SCALE != col.baseTI.scale) {
613
else if (
TdsEnums
.UNKNOWN_PRECISION_SCALE != col.scale) {
2769
case
TdsEnums
.SQLALTROW:
2782
case
TdsEnums
.SQLROW:
2783
case
TdsEnums
.SQLNBCROW:
2791
case
TdsEnums
.SQLDONE:
2798
case
TdsEnums
.SQLCOLMETADATA:
2862
while ( b ==
TdsEnums
.SQLDONE ||
2863
b ==
TdsEnums
.SQLDONEPROC ||
2864
b ==
TdsEnums
.SQLDONEINPROC ||
2866
b ==
TdsEnums
.SQLSESSIONSTATE ||
2867
b ==
TdsEnums
.SQLENVCHANGE ||
2868
b ==
TdsEnums
.SQLORDER ||
2869
b ==
TdsEnums
.SQLERROR ||
2870
b ==
TdsEnums
.SQLINFO ) ) {
2872
if (b ==
TdsEnums
.SQLDONE ||
2873
b ==
TdsEnums
.SQLDONEPROC ||
2874
b ==
TdsEnums
.SQLDONEINPROC) {
2914
return
TdsEnums
.SQLROW == token ||
TdsEnums
.SQLNBCROW == token;
3594
byte typeAndMask = (byte)(_metaData[currentColumn].tdsType &
TdsEnums
.SQLLenMask);
3595
if ((typeAndMask ==
TdsEnums
.SQLVarLen) || (typeAndMask ==
TdsEnums
.SQLVarCnt)) {
3711
if (
TdsEnums
.SQLORDER == b) {
3720
if (b ==
TdsEnums
.SQLINFO) {
3782
if (b ==
TdsEnums
.SQLORDER) { // same logic as SetAltMetaDataSet
3794
if (b ==
TdsEnums
.SQLINFO)
3814
if (
TdsEnums
.SQLALTMETADATA == b)
fx\src\data\System\Data\SqlClient\SqlDataReaderSmi.cs (1)
569
maxLength =
TdsEnums
.MAX_NUMERIC_LEN; // SQLBUDT 339686
fx\src\data\System\Data\SqlClient\SqlEnums.cs (120)
199
case (SqlDbType)
TdsEnums
.SmallVarBinary: return MetaSmallVarBinary;
291
if (!inferLen || ((byte[]) value).Length <=
TdsEnums
.TYPE_SIZE_LIMIT) {
418
if ((len << 1) >
TdsEnums
.TYPE_SIZE_LIMIT) {
639
case
TdsEnums
.SQLMONEYN: return ((4 == length) ? MetaSmallMoney : MetaMoney);
640
case
TdsEnums
.SQLDATETIMN: return ((4 == length) ? MetaSmallDateTime : MetaDateTime);
641
case
TdsEnums
.SQLINTN: return ((4 <= length) ? ((4 == length) ? MetaInt : MetaBigInt) : ((2 == length) ? MetaSmallInt : MetaTinyInt));
642
case
TdsEnums
.SQLFLTN: return ((4 == length) ? MetaReal : MetaFloat);
643
case
TdsEnums
.SQLTEXT: return MetaText;
644
case
TdsEnums
.SQLVARBINARY: return MetaSmallVarBinary;
645
case
TdsEnums
.SQLBIGVARBINARY: return MetaVarBinary;
647
case
TdsEnums
.SQLVARCHAR: //goto TdsEnums.SQLBIGVARCHAR;
648
case
TdsEnums
.SQLBIGVARCHAR: return MetaVarChar;
650
case
TdsEnums
.SQLBINARY: //goto TdsEnums.SQLBIGBINARY;
651
case
TdsEnums
.SQLBIGBINARY: return ((
TdsEnums
.SQLTIMESTAMP == userType) ? MetaTimestamp : MetaBinary);
653
case
TdsEnums
.SQLIMAGE: return MetaImage;
655
case
TdsEnums
.SQLCHAR: //goto TdsEnums.SQLBIGCHAR;
656
case
TdsEnums
.SQLBIGCHAR: return MetaChar;
658
case
TdsEnums
.SQLINT1: return MetaTinyInt;
660
case
TdsEnums
.SQLBIT: //goto TdsEnums.SQLBITN;
661
case
TdsEnums
.SQLBITN: return MetaBit;
663
case
TdsEnums
.SQLINT2: return MetaSmallInt;
664
case
TdsEnums
.SQLINT4: return MetaInt;
665
case
TdsEnums
.SQLINT8: return MetaBigInt;
666
case
TdsEnums
.SQLMONEY: return MetaMoney;
667
case
TdsEnums
.SQLDATETIME: return MetaDateTime;
668
case
TdsEnums
.SQLFLT8: return MetaFloat;
669
case
TdsEnums
.SQLFLT4: return MetaReal;
670
case
TdsEnums
.SQLMONEY4: return MetaSmallMoney;
671
case
TdsEnums
.SQLDATETIM4: return MetaSmallDateTime;
673
case
TdsEnums
.SQLDECIMALN: //goto TdsEnums.SQLNUMERICN;
674
case
TdsEnums
.SQLNUMERICN: return MetaDecimal;
676
case
TdsEnums
.SQLUNIQUEID: return MetaUniqueId ;
677
case
TdsEnums
.SQLNCHAR: return MetaNChar;
678
case
TdsEnums
.SQLNVARCHAR: return MetaNVarChar;
679
case
TdsEnums
.SQLNTEXT: return MetaNText;
680
case
TdsEnums
.SQLVARIANT: return MetaVariant;
681
case
TdsEnums
.SQLUDT: return MetaUdt;
682
case
TdsEnums
.SQLXMLTYPE: return MetaXml;
683
case
TdsEnums
.SQLTABLE: return MetaTable;
684
case
TdsEnums
.SQLDATE: return MetaDate;
685
case
TdsEnums
.SQLTIME: return MetaTime;
686
case
TdsEnums
.SQLDATETIME2: return MetaDateTime2;
687
case
TdsEnums
.SQLDATETIMEOFFSET: return MetaDateTimeOffset;
689
case
TdsEnums
.SQLVOID:
707
(19, 255, 8, true, false, false,
TdsEnums
.SQLINT8,
TdsEnums
.SQLINTN, MetaTypeName.BIGINT, typeof(System.Int64), typeof(SqlInt64), SqlDbType.BigInt, DbType.Int64, 0);
710
(15, 255, 8, true, false, false,
TdsEnums
.SQLFLT8,
TdsEnums
.SQLFLTN, MetaTypeName.FLOAT, typeof(System.Double), typeof(SqlDouble), SqlDbType.Float, DbType.Double, 0);
713
(7, 255, 4, true, false, false,
TdsEnums
.SQLFLT4,
TdsEnums
.SQLFLTN, MetaTypeName.REAL, typeof(System.Single), typeof(SqlSingle), SqlDbType.Real, DbType.Single, 0);
718
(255, 255, -1, false, false, false,
TdsEnums
.SQLBIGBINARY,
TdsEnums
.SQLBIGBINARY, MetaTypeName.BINARY, typeof(System.Byte[]), typeof(SqlBinary), SqlDbType.Binary, DbType.Binary, 2);
722
(255, 255, -1, false, false, false,
TdsEnums
.SQLBIGBINARY,
TdsEnums
.SQLBIGBINARY, MetaTypeName.TIMESTAMP, typeof(System.Byte[]), typeof(SqlBinary), SqlDbType.Timestamp, DbType.Binary, 2);
725
(255, 255, -1, false, false, false,
TdsEnums
.SQLBIGVARBINARY,
TdsEnums
.SQLBIGVARBINARY, MetaTypeName.VARBINARY, typeof(System.Byte[]), typeof(SqlBinary), SqlDbType.VarBinary, DbType.Binary, 2);
728
(255, 255, -1, false, true, true,
TdsEnums
.SQLBIGVARBINARY,
TdsEnums
.SQLBIGVARBINARY, MetaTypeName.VARBINARY, typeof(System.Byte[]), typeof(SqlBinary), SqlDbType.VarBinary, DbType.Binary, 2);
734
(255, 255, -1, false, false, false,
TdsEnums
.SQLVARBINARY,
TdsEnums
.SQLBIGBINARY, ADP.StrEmpty, typeof(System.Byte[]), typeof(SqlBinary),
TdsEnums
.SmallVarBinary, DbType.Binary, 2);
737
(255, 255, -1, false, true, false,
TdsEnums
.SQLIMAGE,
TdsEnums
.SQLIMAGE, MetaTypeName.IMAGE, typeof(System.Byte[]), typeof(SqlBinary), SqlDbType.Image, DbType.Binary, 0);
740
(255, 255, 1, true, false, false,
TdsEnums
.SQLBIT,
TdsEnums
.SQLBITN, MetaTypeName.BIT, typeof(System.Boolean), typeof(SqlBoolean), SqlDbType.Bit, DbType.Boolean, 0);
743
(3, 255, 1, true, false, false,
TdsEnums
.SQLINT1,
TdsEnums
.SQLINTN, MetaTypeName.TINYINT, typeof(System.Byte), typeof(SqlByte), SqlDbType.TinyInt, DbType.Byte, 0);
746
(5, 255, 2, true, false, false,
TdsEnums
.SQLINT2,
TdsEnums
.SQLINTN, MetaTypeName.SMALLINT, typeof(System.Int16), typeof(SqlInt16), SqlDbType.SmallInt, DbType.Int16, 0);
749
(10, 255, 4, true, false, false,
TdsEnums
.SQLINT4,
TdsEnums
.SQLINTN, MetaTypeName.INT, typeof(System.Int32), typeof(SqlInt32), SqlDbType.Int, DbType.Int32, 0);
755
(255, 255, -1, false, false, false,
TdsEnums
.SQLBIGCHAR,
TdsEnums
.SQLBIGCHAR, MetaTypeName.CHAR, typeof(System.String), typeof(SqlString), SqlDbType.Char, DbType.AnsiStringFixedLength, 7);
758
(255, 255, -1, false, false, false,
TdsEnums
.SQLBIGVARCHAR,
TdsEnums
.SQLBIGVARCHAR, MetaTypeName.VARCHAR, typeof(System.String), typeof(SqlString), SqlDbType.VarChar, DbType.AnsiString, 7);
761
(255, 255, -1, false, true, true,
TdsEnums
.SQLBIGVARCHAR,
TdsEnums
.SQLBIGVARCHAR, MetaTypeName.VARCHAR, typeof(System.String), typeof(SqlString), SqlDbType.VarChar, DbType.AnsiString, 7);
764
(255, 255, -1, false, true, false,
TdsEnums
.SQLTEXT,
TdsEnums
.SQLTEXT, MetaTypeName.TEXT, typeof(System.String), typeof(SqlString), SqlDbType.Text, DbType.AnsiString, 0);
770
(255, 255, -1, false, false, false,
TdsEnums
.SQLNCHAR,
TdsEnums
.SQLNCHAR, MetaTypeName.NCHAR, typeof(System.String), typeof(SqlString), SqlDbType.NChar, DbType.StringFixedLength, 7);
773
(255, 255, -1, false, false, false,
TdsEnums
.SQLNVARCHAR,
TdsEnums
.SQLNVARCHAR, MetaTypeName.NVARCHAR, typeof(System.String), typeof(SqlString), SqlDbType.NVarChar, DbType.String, 7);
776
(255, 255, -1, false, true, true,
TdsEnums
.SQLNVARCHAR,
TdsEnums
.SQLNVARCHAR, MetaTypeName.NVARCHAR, typeof(System.String), typeof(SqlString), SqlDbType.NVarChar, DbType.String, 7);
779
(255, 255, -1, false, true, false,
TdsEnums
.SQLNTEXT,
TdsEnums
.SQLNTEXT, MetaTypeName.NTEXT, typeof(System.String), typeof(SqlString), SqlDbType.NText, DbType.String, 7);
785
(38, 4, 17, true, false, false,
TdsEnums
.SQLNUMERICN,
TdsEnums
.SQLNUMERICN, MetaTypeName.DECIMAL, typeof(System.Decimal), typeof(SqlDecimal), SqlDbType.Decimal, DbType.Decimal, 2);
788
(255, 255, -1, false, true, true,
TdsEnums
.SQLXMLTYPE,
TdsEnums
.SQLXMLTYPE, MetaTypeName.XML, typeof(System.String), typeof(SqlXml), SqlDbType.Xml, DbType.Xml, 0);
791
(23, 3, 8, true, false, false,
TdsEnums
.SQLDATETIME,
TdsEnums
.SQLDATETIMN, MetaTypeName.DATETIME, typeof(System.DateTime), typeof(SqlDateTime), SqlDbType.DateTime, DbType.DateTime, 0);
794
(16, 0, 4, true, false, false,
TdsEnums
.SQLDATETIM4,
TdsEnums
.SQLDATETIMN, MetaTypeName.SMALLDATETIME, typeof(System.DateTime), typeof(SqlDateTime), SqlDbType.SmallDateTime, DbType.DateTime, 0);
797
(19, 255, 8, true, false, false,
TdsEnums
.SQLMONEY,
TdsEnums
.SQLMONEYN, MetaTypeName.MONEY, typeof(System.Decimal), typeof(SqlMoney), SqlDbType.Money, DbType.Currency, 0);
800
(10, 255, 4, true, false, false,
TdsEnums
.SQLMONEY4,
TdsEnums
.SQLMONEYN, MetaTypeName.SMALLMONEY, typeof(System.Decimal), typeof(SqlMoney), SqlDbType.SmallMoney, DbType.Currency, 0);
803
(255, 255, 16, true, false, false,
TdsEnums
.SQLUNIQUEID,
TdsEnums
.SQLUNIQUEID, MetaTypeName.ROWGUID, typeof(System.Guid), typeof(SqlGuid), SqlDbType.UniqueIdentifier, DbType.Guid, 0);
806
(255, 255, -1, true, false, false,
TdsEnums
.SQLVARIANT,
TdsEnums
.SQLVARIANT, MetaTypeName.VARIANT, typeof(System.Object), typeof(System.Object), SqlDbType.Variant, DbType.Object, 0);
809
(255, 255, -1, false, false, true,
TdsEnums
.SQLUDT,
TdsEnums
.SQLUDT, MetaTypeName.UDT, typeof(System.Object), typeof(System.Object), SqlDbType.Udt, DbType.Object, 0);
812
(255, 255, -1, false, true, true,
TdsEnums
.SQLUDT,
TdsEnums
.SQLUDT, MetaTypeName.UDT, typeof(System.Object), typeof(System.Object), SqlDbType.Udt, DbType.Object, 0);
815
(255, 255, -1, false, false, false,
TdsEnums
.SQLTABLE,
TdsEnums
.SQLTABLE, MetaTypeName.TABLE, typeof(IEnumerable<DbDataRecord>), typeof(IEnumerable<DbDataRecord>), SqlDbType.Structured, DbType.Object, 0);
820
(255, 255, -1, false, false, false,
TdsEnums
.SQLVOID,
TdsEnums
.SQLVOID, "", typeof(MSS.SqlDataRecord), typeof(MSS.SqlDataRecord), SqlDbType.Structured, DbType.Object, 0);
823
(255, 255, 3, true, false, false,
TdsEnums
.SQLDATE,
TdsEnums
.SQLDATE, MetaTypeName.DATE, typeof(System.DateTime), typeof(System.DateTime), SqlDbType.Date, DbType.Date, 0);
826
(255, 7, -1, false, false, false,
TdsEnums
.SQLTIME,
TdsEnums
.SQLTIME, MetaTypeName.TIME, typeof(System.TimeSpan), typeof(System.TimeSpan), SqlDbType.Time, DbType.Time, 1);
829
(255, 7, -1, false, false, false,
TdsEnums
.SQLDATETIME2,
TdsEnums
.SQLDATETIME2, MetaTypeName.DATETIME2, typeof(System.DateTime), typeof(System.DateTime), SqlDbType.DateTime2, DbType.DateTime2, 1);
832
(255, 7, -1, false, false, false,
TdsEnums
.SQLDATETIMEOFFSET,
TdsEnums
.SQLDATETIMEOFFSET, MetaTypeName.DATETIMEOFFSET, typeof(System.DateTimeOffset), typeof(System.DateTimeOffset), SqlDbType.DateTimeOffset, DbType.DateTimeOffset, 1);
fx\src\data\System\Data\SqlClient\SqlError.cs (1)
20
private string source =
TdsEnums
.SQL_PROVIDER_NAME;
fx\src\data\System\Data\SqlClient\SqlInternalConnection.cs (2)
473
if (e.Class >=
TdsEnums
.FATAL_ERROR_CLASS) {
720
else if (exception.Class >=
TdsEnums
.MIN_ERROR_CLASS) {
fx\src\data\System\Data\SqlClient\SqlInternalConnectionTds.cs (70)
974
sqlBatch.Append(
TdsEnums
.TRANS_READ_COMMITTED);
978
sqlBatch.Append(
TdsEnums
.TRANS_READ_UNCOMMITTED);
982
sqlBatch.Append(
TdsEnums
.TRANS_REPEATABLE_READ);
986
sqlBatch.Append(
TdsEnums
.TRANS_SERIALIZABLE);
1005
sqlBatch.Append(
TdsEnums
.TRANS_BEGIN);
1012
sqlBatch.Append(
TdsEnums
.TRANS_COMMIT);
1016
sqlBatch.Append(
TdsEnums
.TRANS_ROLLBACK);
1020
sqlBatch.Append(
TdsEnums
.TRANS_IF_ROLLBACK);
1024
sqlBatch.Append(
TdsEnums
.TRANS_SAVE);
1053
TdsEnums
.TransactionManagerRequestType requestType =
TdsEnums
.TransactionManagerRequestType.Begin;
1054
TdsEnums
.TransactionManagerIsolationLevel isoLevel =
TdsEnums
.TransactionManagerIsolationLevel.ReadCommitted;
1058
isoLevel =
TdsEnums
.TransactionManagerIsolationLevel.Unspecified;
1061
isoLevel =
TdsEnums
.TransactionManagerIsolationLevel.ReadCommitted;
1064
isoLevel =
TdsEnums
.TransactionManagerIsolationLevel.ReadUncommitted;
1067
isoLevel =
TdsEnums
.TransactionManagerIsolationLevel.RepeatableRead;
1070
isoLevel =
TdsEnums
.TransactionManagerIsolationLevel.Serializable;
1073
isoLevel =
TdsEnums
.TransactionManagerIsolationLevel.Snapshot;
1095
requestType =
TdsEnums
.TransactionManagerRequestType.Begin;
1098
requestType =
TdsEnums
.TransactionManagerRequestType.Promote;
1101
requestType =
TdsEnums
.TransactionManagerRequestType.Commit;
1108
requestType =
TdsEnums
.TransactionManagerRequestType.Rollback;
1111
requestType =
TdsEnums
.TransactionManagerRequestType.Save;
1315
TdsEnums
.FeatureExtension requestedFeatures =
TdsEnums
.FeatureExtension.None;
1317
requestedFeatures |=
TdsEnums
.FeatureExtension.SessionRecovery;
1327
requestedFeatures |=
TdsEnums
.FeatureExtension.FedAuth;
1331
libraryType =
TdsEnums
.FedAuthLibrary.ADAL,
1337
requestedFeatures |=
TdsEnums
.FeatureExtension.FedAuth;
1339
libraryType =
TdsEnums
.FedAuthLibrary.SecurityToken,
1348
requestedFeatures |=
TdsEnums
.FeatureExtension.Tce |
TdsEnums
.FeatureExtension.GlobalTransactions;
1352
requestedFeatures |=
TdsEnums
.FeatureExtension.AzureSQLSupport;
1448
return (
TdsEnums
.LOGON_FAILED == exc.Number) // actual logon failed, i.e. bad password
1449
|| (
TdsEnums
.PASSWORD_EXPIRED == exc.Number) // actual logon failed, i.e. password isExpired
1450
|| (
TdsEnums
.IMPERSONATION_FAILED == exc.Number) // Insuficient privelege for named pipe, among others
2102
case
TdsEnums
.ENV_DATABASE:
2111
case
TdsEnums
.ENV_LANG:
2120
case
TdsEnums
.ENV_PACKETSIZE:
2124
case
TdsEnums
.ENV_COLLATION:
2130
case
TdsEnums
.ENV_CHARSET:
2131
case
TdsEnums
.ENV_LOCALEID:
2132
case
TdsEnums
.ENV_COMPFLAGS:
2133
case
TdsEnums
.ENV_BEGINTRAN:
2134
case
TdsEnums
.ENV_COMMITTRAN:
2135
case
TdsEnums
.ENV_ROLLBACKTRAN:
2136
case
TdsEnums
.ENV_ENLISTDTC:
2137
case
TdsEnums
.ENV_DEFECTDTC:
2141
case
TdsEnums
.ENV_LOGSHIPNODE:
2145
case
TdsEnums
.ENV_PROMOTETRANSACTION:
2149
case
TdsEnums
.ENV_TRANSACTIONENDED:
2152
case
TdsEnums
.ENV_TRANSACTIONMANAGERADDRESS:
2156
case
TdsEnums
.ENV_SPRESETCONNECTIONACK:
2163
case
TdsEnums
.ENV_USERINSTANCE:
2167
case
TdsEnums
.ENV_ROUTING:
2391
username =
TdsEnums
.NTAUTHORITYANONYMOUSLOGON;
2452
sqlErs.Add(new SqlError(0, (byte)0x00, (byte)
TdsEnums
.MIN_ERROR_CLASS, ConnectionOptions.DataSource, Res.GetString(Res.SQL_ADALFailure, username, ConnectionOptions.Authentication.ToString("G")), ActiveDirectoryAuthentication.AdalGetAccessTokenFunctionName, 0));
2456
sqlErs.Add(new SqlError(0, (byte)0x00, (byte)
TdsEnums
.MIN_ERROR_CLASS, ConnectionOptions.DataSource, errorMessage1, ActiveDirectoryAuthentication.AdalGetAccessTokenFunctionName, 0));
2460
sqlErs.Add(new SqlError(0, (byte)0x00, (byte)
TdsEnums
.MIN_ERROR_CLASS, ConnectionOptions.DataSource, adalException.Message, ActiveDirectoryAuthentication.AdalGetAccessTokenFunctionName, 0));
2493
case
TdsEnums
.FEATUREEXT_SRECOVERY: {
2530
case
TdsEnums
.FEATUREEXT_FEDAUTH: {
2542
case
TdsEnums
.FedAuthLibrary.ADAL:
2543
case
TdsEnums
.FedAuthLibrary.SecurityToken:
2581
case
TdsEnums
.FEATUREEXT_TCE: {
2592
if (0 == supportedTceVersion || supportedTceVersion >
TdsEnums
.MAX_SUPPORTED_TCE_VERSION) {
2598
Debug.Assert (_tceVersionSupported <=
TdsEnums
.MAX_SUPPORTED_TCE_VERSION, "Client support TCE version 2");
2609
case
TdsEnums
.FEATUREEXT_GLOBALTRANSACTIONS: {
2626
case
TdsEnums
.FEATUREEXT_AZURESQLSUPPORT: {
2745
UserProtocol =
TdsEnums
.TCP;
fx\src\data\System\Data\SqlClient\SqlParameter.cs (13)
472
if ((!ADP.IsEmpty(typeSpecificNamePart1) &&
TdsEnums
.MAX_SERVERNAME < typeSpecificNamePart1.Length)
473
|| (!ADP.IsEmpty(typeSpecificNamePart2) &&
TdsEnums
.MAX_SERVERNAME < typeSpecificNamePart2.Length)
474
|| (!ADP.IsEmpty(typeSpecificNamePart3) &&
TdsEnums
.MAX_SERVERNAME < typeSpecificNamePart3.Length)) {
485
precision =
TdsEnums
.DEFAULT_NUMERIC_PRECISION;
532
if (ADP.IsEmpty(value) || (value.Length <
TdsEnums
.MAX_PARAMETER_NAME_LENGTH)
533
|| (('@' == value[0]) && (value.Length <=
TdsEnums
.MAX_PARAMETER_NAME_LENGTH))) {
551
Debug.Assert(parameterName.Length <=
TdsEnums
.MAX_PARAMETER_NAME_LENGTH, "parameter name too long");
579
if (sqlDbType == SqlDbType.Decimal && value >
TdsEnums
.MAX_NUMERIC_PRECISION) {
646
if ((SqlDbType)
TdsEnums
.SmallVarBinary == value) {
884
if (isSqlVariant && (coercedSize >
TdsEnums
.TYPE_SIZE_LIMIT))
958
else if (
TdsEnums
.SQLTABLE == destinationType.TDSType &&
1080
return
TdsEnums
.DEFAULT_VARTIME_SCALE;
1570
if ((maxSizeInBytes >
TdsEnums
.TYPE_SIZE_LIMIT) || (_coercedValueIsDataFeed) ||
fx\src\data\System\Data\SqlClient\SqlSecurityUtility.cs (3)
125
if (
TdsEnums
.CustomCipherAlgorithmId == cipherAlgorithmId) {
132
else if (
TdsEnums
.AEAD_AES_256_CBC_HMAC_SHA256 == cipherAlgorithmId) {
135
else if (
TdsEnums
.AES_256_CBC == cipherAlgorithmId) {
fx\src\data\System\Data\SqlClient\SqlUtil.cs (95)
594
errors.Add(new SqlError(
TdsEnums
.TIMEOUT_EXPIRED, (byte)0x00,
TdsEnums
.MIN_ERROR_CLASS, null, (Res.GetString(Res.ADP_OpenReaderExists)), "", 0,
TdsEnums
.SNI_WAIT_TIMEOUT));
832
return ADP.Argument(Res.GetString(Res.TCE_InvalidKeyEncryptionAlgorithmSysErr, encryptionAlgorithm, validEncryptionAlgorithm),
TdsEnums
.TCE_PARAM_ENCRYPTION_ALGORITHM);
835
return ADP.Argument(Res.GetString(Res.TCE_InvalidKeyEncryptionAlgorithm, encryptionAlgorithm, validEncryptionAlgorithm),
TdsEnums
.TCE_PARAM_ENCRYPTION_ALGORITHM);
841
return ADP.ArgumentNull (
TdsEnums
.TCE_PARAM_ENCRYPTION_ALGORITHM, Res.GetString(Res.TCE_NullKeyEncryptionAlgorithmSysErr));
844
return ADP.ArgumentNull (
TdsEnums
.TCE_PARAM_ENCRYPTION_ALGORITHM, Res.GetString(Res.TCE_NullKeyEncryptionAlgorithm));
849
return ADP.Argument(Res.GetString(Res.TCE_EmptyColumnEncryptionKey),
TdsEnums
.TCE_PARAM_COLUMNENCRYPTION_KEY);
853
return ADP.ArgumentNull(
TdsEnums
.TCE_PARAM_COLUMNENCRYPTION_KEY, Res.GetString(Res.TCE_NullColumnEncryptionKey));
857
return ADP.Argument(Res.GetString(Res.TCE_EmptyEncryptedColumnEncryptionKey),
TdsEnums
.TCE_PARAM_ENCRYPTED_CEK);
861
return ADP.ArgumentNull(
TdsEnums
.TCE_PARAM_ENCRYPTED_CEK, Res.GetString(Res.TCE_NullEncryptedColumnEncryptionKey));
866
return ADP.Argument(Res.GetString(Res.TCE_LargeCertificatePathLengthSysErr, actualLength, maxLength),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
869
return ADP.Argument(Res.GetString(Res.TCE_LargeCertificatePathLength, actualLength, maxLength),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
876
return ADP.ArgumentNull(
TdsEnums
.TCE_PARAM_MASTERKEY_PATH, Res.GetString(Res.TCE_NullCertificatePathSysErr, validLocations[0], validLocations[1], @"/"));
879
return ADP.ArgumentNull(
TdsEnums
.TCE_PARAM_MASTERKEY_PATH, Res.GetString(Res.TCE_NullCertificatePath, validLocations[0], validLocations[1], @"/"));
885
return ADP.ArgumentNull(
TdsEnums
.TCE_PARAM_MASTERKEY_PATH, Res.GetString(Res.TCE_NullCspPathSysErr, @"/"));
888
return ADP.ArgumentNull(
TdsEnums
.TCE_PARAM_MASTERKEY_PATH, Res.GetString(Res.TCE_NullCspPath, @"/"));
894
return ADP.ArgumentNull(
TdsEnums
.TCE_PARAM_MASTERKEY_PATH, Res.GetString(Res.TCE_NullCngPathSysErr, @"/"));
897
return ADP.ArgumentNull(
TdsEnums
.TCE_PARAM_MASTERKEY_PATH, Res.GetString(Res.TCE_NullCngPath, @"/"));
904
return ADP.Argument(Res.GetString(Res.TCE_InvalidCertificatePathSysErr, actualCertificatePath, validLocations[0], validLocations[1], @"/"),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
907
return ADP.Argument(Res.GetString(Res.TCE_InvalidCertificatePath, actualCertificatePath, validLocations[0], validLocations[1], @"/"),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
913
return ADP.Argument(Res.GetString(Res.TCE_InvalidCspPathSysErr, masterKeyPath, @"/"),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
916
return ADP.Argument(Res.GetString(Res.TCE_InvalidCspPath, masterKeyPath, @"/"),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
922
return ADP.Argument(Res.GetString(Res.TCE_InvalidCngPathSysErr, masterKeyPath, @"/"),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
925
return ADP.Argument(Res.GetString(Res.TCE_InvalidCngPath, masterKeyPath, @"/"),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
931
return ADP.Argument(Res.GetString(Res.TCE_EmptyCspNameSysErr, masterKeyPath, @"/"),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
934
return ADP.Argument(Res.GetString(Res.TCE_EmptyCspName, masterKeyPath, @"/"),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
940
return ADP.Argument(Res.GetString(Res.TCE_EmptyCngNameSysErr, masterKeyPath, @"/"),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
943
return ADP.Argument(Res.GetString(Res.TCE_EmptyCngName, masterKeyPath, @"/"),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
949
return ADP.Argument(Res.GetString(Res.TCE_EmptyCspKeyIdSysErr, masterKeyPath, @"/"),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
952
return ADP.Argument(Res.GetString(Res.TCE_EmptyCspKeyId, masterKeyPath, @"/"),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
958
return ADP.Argument(Res.GetString(Res.TCE_EmptyCngKeyIdSysErr, masterKeyPath, @"/"),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
961
return ADP.Argument(Res.GetString(Res.TCE_EmptyCngKeyId, masterKeyPath, @"/"),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
967
return ADP.Argument(Res.GetString(Res.TCE_InvalidCspNameSysErr, cspName, masterKeyPath),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
970
return ADP.Argument(Res.GetString(Res.TCE_InvalidCspName, cspName, masterKeyPath),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
976
return ADP.Argument(Res.GetString(Res.TCE_InvalidCspKeyIdSysErr, keyIdentifier, masterKeyPath),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
979
return ADP.Argument(Res.GetString(Res.TCE_InvalidCspKeyId, keyIdentifier, masterKeyPath),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
985
return ADP.Argument(Res.GetString(Res.TCE_InvalidCngKeySysErr, masterKeyPath, cngProviderName, keyIdentifier),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
988
return ADP.Argument(Res.GetString(Res.TCE_InvalidCngKey, masterKeyPath, cngProviderName, keyIdentifier),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
995
return ADP.Argument(Res.GetString(Res.TCE_InvalidCertificateLocationSysErr, certificateLocation, certificatePath, validLocations[0], validLocations[1], @"/"),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
998
return ADP.Argument(Res.GetString(Res.TCE_InvalidCertificateLocation, certificateLocation, certificatePath, validLocations[0], validLocations[1], @"/"),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
1004
return ADP.Argument(Res.GetString(Res.TCE_InvalidCertificateStoreSysErr, certificateStore, certificatePath, validCertificateStore),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
1007
return ADP.Argument(Res.GetString(Res.TCE_InvalidCertificateStore, certificateStore, certificatePath, validCertificateStore),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
1013
return ADP.Argument(Res.GetString(Res.TCE_EmptyCertificateThumbprintSysErr, certificatePath),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
1016
return ADP.Argument(Res.GetString(Res.TCE_EmptyCertificateThumbprint, certificatePath),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
1022
return ADP.Argument(Res.GetString(Res.TCE_CertificateNotFoundSysErr, thumbprint, certificateLocation, certificateStore),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
1025
return ADP.Argument(Res.GetString(Res.TCE_CertificateNotFound, thumbprint, certificateLocation, certificateStore),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
1030
return ADP.Argument(Res.GetString(Res.TCE_InvalidAlgorithmVersionInEncryptedCEK, actual.ToString(@"X2"), expected.ToString(@"X2")),
TdsEnums
.TCE_PARAM_ENCRYPTED_CEK);
1034
return ADP.Argument(Res.GetString(Res.TCE_InvalidCiphertextLengthInEncryptedCEK, actual, expected, certificateName),
TdsEnums
.TCE_PARAM_ENCRYPTED_CEK);
1038
return ADP.Argument(Res.GetString(Res.TCE_InvalidCiphertextLengthInEncryptedCEKCsp, actual, expected, masterKeyPath),
TdsEnums
.TCE_PARAM_ENCRYPTED_CEK);
1042
return ADP.Argument(Res.GetString(Res.TCE_InvalidCiphertextLengthInEncryptedCEKCng, actual, expected, masterKeyPath),
TdsEnums
.TCE_PARAM_ENCRYPTED_CEK);
1046
return ADP.Argument(Res.GetString(Res.TCE_InvalidSignatureInEncryptedCEK, actual, expected, masterKeyPath),
TdsEnums
.TCE_PARAM_ENCRYPTED_CEK);
1050
return ADP.Argument(Res.GetString(Res.TCE_InvalidSignatureInEncryptedCEKCsp, actual, expected, masterKeyPath),
TdsEnums
.TCE_PARAM_ENCRYPTED_CEK);
1054
return ADP.Argument(Res.GetString(Res.TCE_InvalidSignatureInEncryptedCEKCng, actual, expected, masterKeyPath),
TdsEnums
.TCE_PARAM_ENCRYPTED_CEK);
1058
return ADP.Argument(Res.GetString(Res.TCE_InvalidCertificateSignature, certificatePath),
TdsEnums
.TCE_PARAM_ENCRYPTED_CEK);
1062
return ADP.Argument(Res.GetString(Res.TCE_InvalidSignature, masterKeyPath),
TdsEnums
.TCE_PARAM_ENCRYPTED_CEK);
1067
return ADP.Argument(Res.GetString(Res.TCE_CertificateWithNoPrivateKeySysErr, keyPath),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
1070
return ADP.Argument(Res.GetString(Res.TCE_CertificateWithNoPrivateKey, keyPath),
TdsEnums
.TCE_PARAM_MASTERKEY_PATH);
1078
return ADP.ArgumentNull(
TdsEnums
.TCE_PARAM_ENCRYPTIONKEY,Res.GetString(Res.TCE_NullColumnEncryptionKeySysErr));
1086
expectedLength),
TdsEnums
.TCE_PARAM_ENCRYPTIONKEY);
1095
string.Join(valueSeparator, validEncryptionTypes.Select((validEncryptionType => @"'" + validEncryptionType + @"'")))),
TdsEnums
.TCE_PARAM_ENCRYPTIONTYPE);
1111
return ADP.Argument(Res.GetString(Res.TCE_InvalidCipherTextSize, actualSize, minimumSize),
TdsEnums
.TCE_PARAM_CIPHERTEXT);
1115
return ADP.Argument(Res.GetString(Res.TCE_InvalidAlgorithmVersion, actual.ToString(@"X2"), expected.ToString(@"X2")),
TdsEnums
.TCE_PARAM_CIPHERTEXT);
1119
return ADP.Argument(Res.GetString(Res.TCE_InvalidAuthenticationTag),
TdsEnums
.TCE_PARAM_CIPHERTEXT);
1123
return ADP.ArgumentNull (
TdsEnums
.TCE_PARAM_ENCRYPTION_ALGORITHM, Res.GetString(Res.TCE_NullColumnEncryptionAlgorithm, supportedAlgorithms));
1153
return ADP.InvalidOperation(Res.GetString(Res.TCE_ParamInvalidForceColumnEncryptionSetting,
TdsEnums
.TCE_PARAM_FORCE_COLUMN_ENCRYPTION, paramName, procedureName, "SqlParameter"));
1157
return ADP.InvalidOperation(Res.GetString(Res.TCE_ParamUnExpectedEncryptionMetadata, paramName, procedureName,
TdsEnums
.TCE_PARAM_FORCE_COLUMN_ENCRYPTION, "SqlParameter"));
1292
sqlErs.Add (new SqlError(infoNumber:0, errorState:(byte)0x00, errorClass:(byte)
TdsEnums
.MIN_ERROR_CLASS, server:serverName, errorMessage:errorMessage, procedure:null, lineNumber:0));
1302
sqlErs.Add (new SqlError(infoNumber:0, errorState:(byte)0x00, errorClass:(byte)
TdsEnums
.MIN_ERROR_CLASS, server:serverName, errorMessage:e.Message, procedure:null, lineNumber:0));
1328
return ADP.Argument(Res.GetString(Res.TCE_UnknownColumnEncryptionAlgorithmId, algoId, supportAlgorithmIds),
TdsEnums
.TCE_PARAM_CIPHER_ALGORITHM_ID);
1398
return ADP.ArgumentNull(
TdsEnums
.TCE_PARAM_CLIENT_KEYSTORE_PROVIDERS, Res.GetString(Res.TCE_NullCustomKeyStoreProviderDictionary));
1402
return ADP.Argument(Res.GetString(Res.TCE_InvalidCustomKeyStoreProviderName, providerName, prefix),
TdsEnums
.TCE_PARAM_CLIENT_KEYSTORE_PROVIDERS);
1406
return ADP.ArgumentNull(
TdsEnums
.TCE_PARAM_CLIENT_KEYSTORE_PROVIDERS, Res.GetString(Res.TCE_NullProviderValue, providerName));
1410
return ADP.ArgumentNull(
TdsEnums
.TCE_PARAM_CLIENT_KEYSTORE_PROVIDERS, Res.GetString(Res.TCE_EmptyProviderName));
1436
TdsEnums
.MT_ATTN, // Message Type
1437
TdsEnums
.ST_EOM, // Status
1438
TdsEnums
.HEADER_LEN >> 8, // length - upper byte
1439
TdsEnums
.HEADER_LEN & 0xff, // length - lower byte
1460
errors.Add(new SqlError(0, (byte)0x00,
TdsEnums
.FATAL_ERROR_CLASS, null, msg, "", 0));
1495
errors.Add(new SqlError(0, (byte)0x00,
TdsEnums
.FATAL_ERROR_CLASS, null, (Res.GetString(Res.SQLROR_FailoverNotSupported)), "", 0));
1503
errors.Add(new SqlError(0, (byte)0x00,
TdsEnums
.FATAL_ERROR_CLASS, null, (Res.GetString(Res.SQLROR_RecursiveRoutingNotSupported)), "", 0));
1511
errors.Add(new SqlError(0, (byte)0x00,
TdsEnums
.FATAL_ERROR_CLASS, null, (Res.GetString(Res.SQLROR_UnexpectedRoutingInfo)), "", 0));
1519
errors.Add(new SqlError(0, (byte)0x00,
TdsEnums
.FATAL_ERROR_CLASS, null, (Res.GetString(Res.SQLROR_InvalidRoutingInfo)), "", 0));
1527
errors.Add(new SqlError(0, (byte)0x00,
TdsEnums
.FATAL_ERROR_CLASS, null, (Res.GetString(Res.SQLROR_TimeoutAfterRoutingInfo)), "", 0));
1538
errors.Add(new SqlError(
TdsEnums
.TIMEOUT_EXPIRED, (byte)0x00,
TdsEnums
.MIN_ERROR_CLASS, null, SQLMessage.Timeout(), "", 0,
TdsEnums
.SNI_WAIT_TIMEOUT));
1545
errors.Add(new SqlError(0, 0,
TdsEnums
.MIN_ERROR_CLASS, null, SQLMessage.OperationCancelled(), "", 0));
1552
errors.Add(new SqlError(0, 0,
TdsEnums
.MIN_ERROR_CLASS, null, Res.GetString(Res.SQLCR_NextAttemptWillExceedQueryTimeout), "", 0));
1559
errors.Add(new SqlError(0, 0,
TdsEnums
.FATAL_ERROR_CLASS, null, Res.GetString(Res.SQLCR_EncryptionChanged), "", 0));
1566
errors.Add(new SqlError(0, 0,
TdsEnums
.MIN_ERROR_CLASS, null, Res.GetString(Res.SQLCR_AllAttemptsFailed), "", 0));
1573
errors.Add(new SqlError(0, 0,
TdsEnums
.FATAL_ERROR_CLASS, null, Res.GetString(Res.SQLCR_NoCRAckAtReconnection), "", 0));
1580
errors.Add(new SqlError(0, 0,
TdsEnums
.FATAL_ERROR_CLASS, null, Res.GetString(Res.SQLCR_TDSVestionNotPreserved), "", 0));
1587
errors.Add(new SqlError(0, 0,
TdsEnums
.FATAL_ERROR_CLASS, null, Res.GetString(Res.SQLCR_UnrecoverableServer), "", 0));
1594
errors.Add(new SqlError(0, 0,
TdsEnums
.FATAL_ERROR_CLASS, null, Res.GetString(Res.SQLCR_UnrecoverableClient), "", 0));
fx\src\data\System\Data\SqlClient\TdsParser.cs (778)
416
if (sniStatus !=
TdsEnums
.SNI_SUCCESS) {
473
if (
TdsEnums
.SNI_SUCCESS != _physicalStateObj.Status) {
507
Debug.Assert(result ==
TdsEnums
.SNI_SUCCESS, "Unexpected failure state upon calling SniGetConnectionId");
530
if (
TdsEnums
.SNI_SUCCESS != _physicalStateObj.Status) {
537
Debug.Assert(retCode ==
TdsEnums
.SNI_SUCCESS, "Unexpected failure state upon calling SniGetConnectionId");
582
if (error !=
TdsEnums
.SNI_SUCCESS) {
604
if (error !=
TdsEnums
.SNI_SUCCESS) {
627
if (
TdsEnums
.SNI_SUCCESS_IO_PENDING != error) {
628
Debug.Assert(
TdsEnums
.SNI_SUCCESS != error, "Unexpected successfull read async on physical connection before enabling MARS!");
727
_physicalStateObj._outputMessageType =
TdsEnums
.MT_PRELOGIN;
733
byte[] payload = new byte[(int)PreLoginOptions.NUMOPT * 5 +
TdsEnums
.MAX_PRELOGIN_PAYLOAD_LENGTH];
869
_physicalStateObj.WritePacket(
TdsEnums
.HARDFLUSH);
886
_physicalStateObj.AddError(new SqlError(0, (byte)0x00,
TdsEnums
.FATAL_ERROR_CLASS, _server, SQLMessage.PreloginError(), "", 0));
893
if (_physicalStateObj._inBytesPacket >
TdsEnums
.MAX_PACKET_SIZE || _physicalStateObj._inBytesPacket <= 0) {
948
_physicalStateObj.AddError(new SqlError(
TdsEnums
.ENCRYPTION_NOT_SUPPORTED, (byte)0x00,
TdsEnums
.FATAL_ERROR_CLASS, _server, SQLMessage.EncryptionNotSupportedByServer(), "", 0));
969
_physicalStateObj.AddError(new SqlError(
TdsEnums
.ENCRYPTION_NOT_SUPPORTED, (byte)0x00,
TdsEnums
.FATAL_ERROR_CLASS, _server, SQLMessage.EncryptionNotSupportedByClient(), "", 0));
990
UInt32 info = (shouldValidateServerCert ?
TdsEnums
.SNI_SSL_VALIDATE_CERTIFICATE : 0)
991
| (isYukonOrLater ?
TdsEnums
.SNI_SSL_USE_SCHANNEL_CACHE : 0);
996
info |=
TdsEnums
.SNI_SSL_IGNORE_CHANNEL_BINDINGS;
1002
if (error !=
TdsEnums
.SNI_SUCCESS) {
1012
if (error !=
TdsEnums
.SNI_SUCCESS)
1254
if ((_state == TdsParserState.OpenNotLoggedIn) && (_connHandler.ConnectionOptions.TransparentNetworkIPResolution || _connHandler.ConnectionOptions.MultiSubnetFailover || _loginWithFailover) && (temp.Count == 1) && ((temp[0].Number ==
TdsEnums
.TIMEOUT_EXPIRED) || (temp[0].Number ==
TdsEnums
.SNI_WAIT_TIMEOUT))) {
1275
if (exception.Procedure ==
TdsEnums
.INIT_ADAL_PACKAGE || exception.Procedure ==
TdsEnums
.INIT_SSPI_PACKAGE) {
1428
return new SqlError((int)sniError.nativeError, 0x00,
TdsEnums
.FATAL_ERROR_CLASS,
1455
stateObj.AddError(new SqlError(
TdsEnums
.TIMEOUT_EXPIRED, (byte)0x00,
TdsEnums
.MIN_ERROR_CLASS, _server, _connHandler.TimeoutErrorInternal.GetErrorMessage(), "", 0,
TdsEnums
.SNI_WAIT_TIMEOUT));
1469
stateObj._outBuff[1] = (Byte)(stateObj._outBuff[1] |
TdsEnums
.ST_RESET_CONNECTION_PRESERVE_TRANSACTION);
1473
stateObj._outBuff[1] = (Byte)(stateObj._outBuff[1] |
TdsEnums
.ST_RESET_CONNECTION);
1790
token ==
TdsEnums
.SQLERROR ||
1791
token ==
TdsEnums
.SQLINFO ||
1792
token ==
TdsEnums
.SQLLOGINACK ||
1793
token ==
TdsEnums
.SQLENVCHANGE ||
1794
token ==
TdsEnums
.SQLRETURNVALUE ||
1795
token ==
TdsEnums
.SQLRETURNSTATUS ||
1796
token ==
TdsEnums
.SQLCOLNAME ||
1797
token ==
TdsEnums
.SQLCOLFMT ||
1798
token ==
TdsEnums
.SQLCOLMETADATA ||
1799
token ==
TdsEnums
.SQLALTMETADATA ||
1800
token ==
TdsEnums
.SQLTABNAME ||
1801
token ==
TdsEnums
.SQLCOLINFO ||
1802
token ==
TdsEnums
.SQLORDER ||
1803
token ==
TdsEnums
.SQLALTROW ||
1804
token ==
TdsEnums
.SQLROW ||
1805
token ==
TdsEnums
.SQLNBCROW ||
1806
token ==
TdsEnums
.SQLDONE ||
1807
token ==
TdsEnums
.SQLDONEPROC ||
1808
token ==
TdsEnums
.SQLDONEINPROC ||
1809
token ==
TdsEnums
.SQLROWCRC ||
1810
token ==
TdsEnums
.SQLSECLEVEL ||
1811
token ==
TdsEnums
.SQLPROCID ||
1812
token ==
TdsEnums
.SQLOFFSET ||
1813
token ==
TdsEnums
.SQLSSPI ||
1814
token ==
TdsEnums
.SQLFEATUREEXTACK ||
1815
token ==
TdsEnums
.SQLSESSIONSTATE ||
1816
token ==
TdsEnums
.SQLFEDAUTHINFO);
1884
case
TdsEnums
.SQLERROR:
1885
case
TdsEnums
.SQLINFO:
1887
if (token ==
TdsEnums
.SQLERROR) {
1896
if (token ==
TdsEnums
.SQLINFO && stateObj._accumulateInfoEvents)
1898
Debug.Assert(error.Class <
TdsEnums
.MIN_ERROR_CLASS, "INFO with class > TdsEnums.MIN_ERROR_CLASS");
1916
(error.Class <=
TdsEnums
.MAX_USER_CORRECTABLE_ERROR_CLASS)) {
1922
if (error.Class <
TdsEnums
.MIN_ERROR_CLASS) {
1925
else if (error.Class <
TdsEnums
.FATAL_ERROR_CLASS) {
1954
else if (error.Class >=
TdsEnums
.FATAL_ERROR_CLASS) {
1960
case
TdsEnums
.SQLCOLINFO:
1980
case
TdsEnums
.SQLDONE:
1981
case
TdsEnums
.SQLDONEPROC:
1982
case
TdsEnums
.SQLDONEINPROC:
1988
if ((token ==
TdsEnums
.SQLDONEPROC) && (cmdHandler != null)) {
2003
case
TdsEnums
.SQLORDER:
2012
case
TdsEnums
.SQLALTMETADATA:
2032
if (!dataStream.TrySetAltMetaDataSet(cleanupAltMetaDataSet, (
TdsEnums
.SQLALTMETADATA != metadataConsumedByte))) {
2040
case
TdsEnums
.SQLALTROW:
2064
case
TdsEnums
.SQLENVCHANGE:
2077
case
TdsEnums
.ENV_BEGINTRAN:
2078
case
TdsEnums
.ENV_ENLISTDTC:
2092
TransactionType transactionType = (
TdsEnums
.ENV_BEGINTRAN == env[ii].type) ? TransactionType.LocalFromTSQL : TransactionType.Distributed;
2101
case
TdsEnums
.ENV_DEFECTDTC:
2102
case
TdsEnums
.ENV_TRANSACTIONENDED:
2103
case
TdsEnums
.ENV_COMMITTRAN:
2108
goto case
TdsEnums
.ENV_ROLLBACKTRAN;
2109
case
TdsEnums
.ENV_ROLLBACKTRAN:
2120
if (
TdsEnums
.ENV_COMMITTRAN == env[ii].type) {
2123
else if (
TdsEnums
.ENV_ROLLBACKTRAN == env[ii].type) {
2148
case
TdsEnums
.SQLLOGINACK:
2159
case
TdsEnums
.SQLFEATUREEXTACK:
2166
case
TdsEnums
.SQLFEDAUTHINFO:
2177
case
TdsEnums
.SQLSESSIONSTATE:
2184
case
TdsEnums
.SQLCOLMETADATA:
2186
if (tokenLength !=
TdsEnums
.VARNULL) {
2206
if (!dataStream.TrySetMetaData(stateObj._cleanupMetaData, (
TdsEnums
.SQLTABNAME == peekedToken ||
TdsEnums
.SQLCOLINFO == peekedToken))) {
2215
case
TdsEnums
.SQLROW:
2216
case
TdsEnums
.SQLNBCROW:
2220
if (token ==
TdsEnums
.SQLNBCROW) {
2251
case
TdsEnums
.SQLRETURNSTATUS:
2260
case
TdsEnums
.SQLRETURNVALUE:
2272
case
TdsEnums
.SQLSSPI:
2282
case
TdsEnums
.SQLTABNAME:
2345
stateObj.AddError(new SqlError(0, 0,
TdsEnums
.MIN_ERROR_CLASS, _server, SQLMessage.OperationCancelled(), "", 0));
2387
case
TdsEnums
.ENV_DATABASE:
2388
case
TdsEnums
.ENV_LANG:
2394
case
TdsEnums
.ENV_CHARSET:
2401
if (env.newValue ==
TdsEnums
.DEFAULT_ENGLISH_CODE_PAGE_STRING) {
2402
_defaultCodePage =
TdsEnums
.DEFAULT_ENGLISH_CODE_PAGE_VALUE;
2406
Debug.Assert(env.newValue.Length >
TdsEnums
.CHARSET_CODE_PAGE_OFFSET, "TdsParser.ProcessEnvChange(): charset value received with length <=10");
2408
string stringCodePage = env.newValue.Substring(
TdsEnums
.CHARSET_CODE_PAGE_OFFSET);
2416
case
TdsEnums
.ENV_PACKETSIZE:
2436
Debug.Assert(result ==
TdsEnums
.SNI_SUCCESS, "Unexpected failure state upon calling SNISetInfo");
2441
case
TdsEnums
.ENV_LOCALEID:
2450
case
TdsEnums
.ENV_COMPFLAGS:
2456
case
TdsEnums
.ENV_COLLATION:
2491
case
TdsEnums
.ENV_BEGINTRAN:
2492
case
TdsEnums
.ENV_COMMITTRAN:
2493
case
TdsEnums
.ENV_ROLLBACKTRAN:
2494
case
TdsEnums
.ENV_ENLISTDTC:
2495
case
TdsEnums
.ENV_DEFECTDTC:
2496
case
TdsEnums
.ENV_TRANSACTIONENDED:
2535
case
TdsEnums
.ENV_LOGSHIPNODE:
2543
case
TdsEnums
.ENV_PROMOTETRANSACTION:
2564
case
TdsEnums
.ENV_TRANSACTIONMANAGERADDRESS:
2565
case
TdsEnums
.ENV_SPRESETCONNECTIONACK:
2573
case
TdsEnums
.ENV_USERINSTANCE:
2580
case
TdsEnums
.ENV_ROUTING:
2730
if (
TdsEnums
.DONE_ATTN == (status &
TdsEnums
.DONE_ATTN)) {
2731
Debug.Assert(
TdsEnums
.DONE_MORE != (status &
TdsEnums
.DONE_MORE),"Not expecting DONE_MORE when receiving DONE_ATTN");
2736
if ((null != cmd) && (
TdsEnums
.DONE_COUNT == (status &
TdsEnums
.DONE_COUNT))) {
2737
if (curCmd !=
TdsEnums
.SELECT) {
2747
if (stateObj._receivedColMetaData || (curCmd !=
TdsEnums
.SELECT)) {
2760
if ((
TdsEnums
.DONE_ERROR == (
TdsEnums
.DONE_ERROR & status)) && stateObj.ErrorCount == 0 &&
2762
stateObj.AddError(new SqlError(0, 0,
TdsEnums
.MIN_ERROR_CLASS, _server, SQLMessage.SevereError(), "", 0));
2774
if ((
TdsEnums
.DONE_SRVERROR == (
TdsEnums
.DONE_SRVERROR & status)) && (RunBehavior.Clean != (RunBehavior.Clean & run))) {
2775
stateObj.AddError(new SqlError(0, 0,
TdsEnums
.FATAL_ERROR_CLASS, _server, SQLMessage.SevereError(), "", 0));
2787
if (
TdsEnums
.DONE_MORE != (status &
TdsEnums
.DONE_MORE)) {
2821
if (!(
TdsEnums
.DONE_COUNT == (status &
TdsEnums
.DONE_COUNT))) {
2826
case
TdsEnums
.INSERT:
2827
case
TdsEnums
.DELETE:
2828
case
TdsEnums
.UPDATE:
2829
case
TdsEnums
.MERGE:
2838
case
TdsEnums
.SELECT:
2843
case
TdsEnums
.BEGINXACT:
2850
case
TdsEnums
.OPENCURSOR:
2854
case
TdsEnums
.ABORT:
2858
case
TdsEnums
.ENDXACT:
2865
case
TdsEnums
.BEGINXACT:
2869
case
TdsEnums
.ABORT:
2870
case
TdsEnums
.ENDXACT:
2884
if (featureId !=
TdsEnums
.FEATUREEXT_TERMINATOR) {
2897
} while (featureId !=
TdsEnums
.FEATUREEXT_TERMINATOR);
2909
&& (TceVersionSupported <
TdsEnums
.MIN_TCE_VERSION_WITH_ENCLAVE_SUPPORT)) {
3026
byte[] b = new byte[
TdsEnums
.VERSION_SIZE];
3042
case
TdsEnums
.SPHINXORSHILOH_MAJOR<<24|
TdsEnums
.DEFAULT_MINOR: // Sphinx & Shiloh RTM
3045
case
TdsEnums
.SHILOH_INCREMENT:
3048
case
TdsEnums
.SPHINX_INCREMENT:
3055
case
TdsEnums
.SHILOHSP1_MAJOR<<24|
TdsEnums
.SHILOHSP1_MINOR: // Shiloh SP1
3056
if (increment !=
TdsEnums
.SHILOHSP1_INCREMENT) { throw SQL.InvalidTDSVersion(); }
3059
case
TdsEnums
.YUKON_MAJOR<<24|
TdsEnums
.YUKON_RTM_MINOR: // Yukon
3060
if (increment !=
TdsEnums
.YUKON_INCREMENT) { throw SQL.InvalidTDSVersion(); }
3063
case
TdsEnums
.KATMAI_MAJOR<<24|
TdsEnums
.KATMAI_MINOR:
3064
if (increment !=
TdsEnums
.KATMAI_INCREMENT) { throw SQL.InvalidTDSVersion(); }
3067
case
TdsEnums
.DENALI_MAJOR << 24|
TdsEnums
.DENALI_MINOR:
3068
if (increment !=
TdsEnums
.DENALI_INCREMENT) { throw SQL.InvalidTDSVersion(); }
3119
stateObj.AddError(new SqlError(0, 0,
TdsEnums
.FATAL_ERROR_CLASS, Server, SQLMessage.UserInstanceFailure(), "", 0));
3222
switch ((
TdsEnums
.FedAuthInfoId)id) {
3223
case
TdsEnums
.FedAuthInfoId.Spn:
3226
case
TdsEnums
.FedAuthInfoId.Stsurl:
3273
Debug.Assert(((errorClass >=
TdsEnums
.MIN_ERROR_CLASS) && token ==
TdsEnums
.SQLERROR) ||
3274
((errorClass <
TdsEnums
.MIN_ERROR_CLASS) && token ==
TdsEnums
.SQLINFO), "class and token don't match!");
3404
rec.isEncrypted = (
TdsEnums
.IsEncrypted == (flags &
TdsEnums
.IsEncrypted));
3417
if (tdsType ==
TdsEnums
.SQLXMLTYPE) {
3418
tdsLen =
TdsEnums
.SQL_USHORTVARMAXLEN;
3422
else if (tdsType ==
TdsEnums
.SQLDATE) {
3439
if (tdsLen ==
TdsEnums
.SQL_USHORTVARMAXLEN) {
3466
if (tdsType ==
TdsEnums
.SQLUDT) {
3610
if (
TdsEnums
.CustomCipherAlgorithmId == cipherAlgorithmId) {
3691
codePage =
TdsEnums
.CODE_PAGE_FROM_SORT_ID[collation.sortId];
3853
stateObj.AddError(new SqlError(0, 0,
TdsEnums
.MIN_ERROR_CLASS, _server, SQLMessage.CultureIdError(), "", 0));
3909
case
TdsEnums
.AOPAVG:
3913
case
TdsEnums
.AOPCNT:
3917
case
TdsEnums
.AOPCNTB:
3921
case
TdsEnums
.AOPMAX:
3925
case
TdsEnums
.AOPMIN:
3929
case
TdsEnums
.AOPSUM:
3933
case
TdsEnums
.AOPANY:
3937
case
TdsEnums
.AOPNOOP:
3941
case
TdsEnums
.AOPSTDEV:
3945
case
TdsEnums
.AOPSTDEVP:
3949
case
TdsEnums
.AOPVAR:
3953
case
TdsEnums
.AOPVARP:
4135
return tdsType ==
TdsEnums
.SQLTIME || tdsType ==
TdsEnums
.SQLDATETIME2 || tdsType ==
TdsEnums
.SQLDATETIMEOFFSET;
4145
if (tdsType ==
TdsEnums
.SQLXMLTYPE)
4146
col.length =
TdsEnums
.SQL_USHORTVARMAXLEN; //Use the same length as other plp datatypes
4149
else if (tdsType ==
TdsEnums
.SQLDATE) {
4168
if (
TdsEnums
.SQLUDT == tdsType) {
4174
if (col.length ==
TdsEnums
.SQL_USHORTVARMAXLEN) {
4175
Debug.Assert(tdsType ==
TdsEnums
.SQLXMLTYPE ||
4176
tdsType ==
TdsEnums
.SQLBIGVARCHAR ||
4177
tdsType ==
TdsEnums
.SQLBIGVARBINARY ||
4178
tdsType ==
TdsEnums
.SQLNVARCHAR ||
4179
tdsType ==
TdsEnums
.SQLUDT,
4184
if (tdsType ==
TdsEnums
.SQLXMLTYPE) {
4262
if (_isShiloh && col.metaType.IsCharType && (tdsType !=
TdsEnums
.SQLXMLTYPE)) {
4306
col.updatability = (byte)((flags &
TdsEnums
.Updatability) >> 2);
4307
col.isNullable = (
TdsEnums
.Nullable == (flags &
TdsEnums
.Nullable));
4308
col.isIdentity = (
TdsEnums
.Identity == (flags &
TdsEnums
.Identity));
4315
col.isColumnSet = (
TdsEnums
.IsColumnSet == (flags &
TdsEnums
.IsColumnSet));
4317
col.isEncrypted = (
TdsEnums
.IsEncrypted == (flags &
TdsEnums
.IsEncrypted));
4590
col.isDifferentName = (
TdsEnums
.SQLDifferentName == (status &
TdsEnums
.SQLDifferentName));
4591
col.isExpression = (
TdsEnums
.SQLExpression == (status &
TdsEnums
.SQLExpression));
4592
col.isKey = (
TdsEnums
.SQLKey == (status &
TdsEnums
.SQLKey));
4593
col.isHidden = (
TdsEnums
.SQLHidden == (status &
TdsEnums
.SQLHidden));
4661
if (!stateObj.TrySkipBytes(
TdsEnums
.TEXT_TIME_STAMP_LEN)) {
4698
Debug.Assert((token ==
TdsEnums
.SQLALTROW), "");
4931
if (!stateObj.TrySkipBytes(textPtrLen +
TdsEnums
.TEXT_TIME_STAMP_LEN)) {
4964
return (
TdsEnums
.SQL_PLP_NULL == length);
4968
if ((
TdsEnums
.VARNULL == length) && !mt.IsLong) {
4975
return ((
TdsEnums
.FIXEDNULL == length) && !mt.IsCharType && !mt.IsBinType);
4980
case
TdsEnums
.SQLCHAR:
4981
case
TdsEnums
.SQLBIGCHAR:
4982
case
TdsEnums
.SQLVARCHAR:
4983
case
TdsEnums
.SQLBIGVARCHAR:
4984
case
TdsEnums
.SQLTEXT:
4999
case
TdsEnums
.SQLNCHAR:
5000
case
TdsEnums
.SQLNVARCHAR:
5001
case
TdsEnums
.SQLNTEXT:
5054
case
TdsEnums
.SQLBIT:
5055
case
TdsEnums
.SQLBITN:
5056
case
TdsEnums
.SQLINTN:
5057
case
TdsEnums
.SQLINT1:
5058
case
TdsEnums
.SQLINT2:
5059
case
TdsEnums
.SQLINT4:
5060
case
TdsEnums
.SQLINT8:
5071
if (tdsType ==
TdsEnums
.SQLBIT ||
5072
tdsType ==
TdsEnums
.SQLBITN) {
5077
if (tdsType ==
TdsEnums
.SQLINT1 || denormalizedLength == 1)
5079
else if (tdsType ==
TdsEnums
.SQLINT2 || denormalizedLength == 2)
5081
else if (tdsType ==
TdsEnums
.SQLINT4 || denormalizedLength == 4)
5088
case
TdsEnums
.SQLFLTN:
5090
goto case
TdsEnums
.SQLFLT4;
5093
goto case
TdsEnums
.SQLFLT8;
5096
case
TdsEnums
.SQLFLT4:
5107
case
TdsEnums
.SQLFLT8:
5118
case
TdsEnums
.SQLMONEYN:
5119
case
TdsEnums
.SQLMONEY4:
5120
case
TdsEnums
.SQLMONEY:
5137
case
TdsEnums
.SQLDATETIMN:
5139
goto case
TdsEnums
.SQLDATETIM4;
5142
goto case
TdsEnums
.SQLDATETIME;
5145
case
TdsEnums
.SQLDATETIM4:
5156
case
TdsEnums
.SQLDATETIME:
5168
case
TdsEnums
.SQLUNIQUEID:
5175
case
TdsEnums
.SQLBINARY:
5176
case
TdsEnums
.SQLBIGBINARY:
5177
case
TdsEnums
.SQLBIGVARBINARY:
5178
case
TdsEnums
.SQLVARBINARY:
5179
case
TdsEnums
.SQLIMAGE:
5182
Debug.Assert(length <=
TdsEnums
.MAXSIZE, "Plp data decryption attempted");
5185
if (tdsType ==
TdsEnums
.SQLBINARY || tdsType ==
TdsEnums
.SQLBIGBINARY) {
5195
case
TdsEnums
.SQLDECIMALN:
5196
case
TdsEnums
.SQLNUMERICN:
5214
case
TdsEnums
.SQLCHAR:
5215
case
TdsEnums
.SQLBIGCHAR:
5216
case
TdsEnums
.SQLVARCHAR:
5217
case
TdsEnums
.SQLBIGVARCHAR:
5218
case
TdsEnums
.SQLTEXT:
5233
if (tdsType ==
TdsEnums
.SQLCHAR || tdsType ==
TdsEnums
.SQLBIGCHAR) {
5241
case
TdsEnums
.SQLNCHAR:
5242
case
TdsEnums
.SQLNVARCHAR:
5243
case
TdsEnums
.SQLNTEXT:
5248
if (tdsType ==
TdsEnums
.SQLNCHAR) {
5256
case
TdsEnums
.SQLDATE:
5261
case
TdsEnums
.SQLTIME:
5264
value.SetToTime(unencryptedBytes, length,
TdsEnums
.MAX_TIME_SCALE, denormalizedScale);
5267
case
TdsEnums
.SQLDATETIME2:
5270
value.SetToDateTime2(unencryptedBytes, length,
TdsEnums
.MAX_TIME_SCALE, denormalizedScale);
5273
case
TdsEnums
.SQLDATETIMEOFFSET:
5276
value.SetToDateTimeOffset(unencryptedBytes, length,
TdsEnums
.MAX_TIME_SCALE, denormalizedScale);
5311
case
TdsEnums
.SQLDECIMALN:
5312
case
TdsEnums
.SQLNUMERICN:
5318
case
TdsEnums
.SQLUDT:
5319
case
TdsEnums
.SQLBINARY:
5320
case
TdsEnums
.SQLBIGBINARY:
5321
case
TdsEnums
.SQLBIGVARBINARY:
5322
case
TdsEnums
.SQLVARBINARY:
5323
case
TdsEnums
.SQLIMAGE:
5366
case
TdsEnums
.SQLCHAR:
5367
case
TdsEnums
.SQLBIGCHAR:
5368
case
TdsEnums
.SQLVARCHAR:
5369
case
TdsEnums
.SQLBIGVARCHAR:
5370
case
TdsEnums
.SQLTEXT:
5371
case
TdsEnums
.SQLNCHAR:
5372
case
TdsEnums
.SQLNVARCHAR:
5373
case
TdsEnums
.SQLNTEXT:
5379
case
TdsEnums
.SQLXMLTYPE:
5389
case
TdsEnums
.SQLDATE:
5390
case
TdsEnums
.SQLTIME:
5391
case
TdsEnums
.SQLDATETIME2:
5392
case
TdsEnums
.SQLDATETIMEOFFSET:
5418
case
TdsEnums
.SQLDATE:
5423
case
TdsEnums
.SQLTIME:
5428
case
TdsEnums
.SQLDATETIME2:
5433
case
TdsEnums
.SQLDATETIMEOFFSET:
5448
case
TdsEnums
.SQLBIT:
5449
case
TdsEnums
.SQLBITN:
5458
case
TdsEnums
.SQLINTN:
5460
goto case
TdsEnums
.SQLINT1;
5463
goto case
TdsEnums
.SQLINT2;
5466
goto case
TdsEnums
.SQLINT4;
5469
goto case
TdsEnums
.SQLINT8;
5472
case
TdsEnums
.SQLINT1:
5480
case
TdsEnums
.SQLINT2:
5489
case
TdsEnums
.SQLINT4:
5498
case
TdsEnums
.SQLINT8:
5507
case
TdsEnums
.SQLFLTN:
5509
goto case
TdsEnums
.SQLFLT4;
5512
goto case
TdsEnums
.SQLFLT8;
5515
case
TdsEnums
.SQLFLT4:
5524
case
TdsEnums
.SQLFLT8:
5533
case
TdsEnums
.SQLMONEYN:
5535
goto case
TdsEnums
.SQLMONEY4;
5538
goto case
TdsEnums
.SQLMONEY;
5541
case
TdsEnums
.SQLMONEY:
5559
case
TdsEnums
.SQLMONEY4:
5566
case
TdsEnums
.SQLDATETIMN:
5568
goto case
TdsEnums
.SQLDATETIM4;
5571
goto case
TdsEnums
.SQLDATETIME;
5574
case
TdsEnums
.SQLDATETIM4:
5585
case
TdsEnums
.SQLDATETIME:
5597
case
TdsEnums
.SQLUNIQUEID:
5610
case
TdsEnums
.SQLBINARY:
5611
case
TdsEnums
.SQLBIGBINARY:
5612
case
TdsEnums
.SQLBIGVARBINARY:
5613
case
TdsEnums
.SQLVARBINARY:
5614
case
TdsEnums
.SQLIMAGE:
5617
Debug.Assert(length <=
TdsEnums
.MAXSIZE);
5627
case
TdsEnums
.SQLVARIANT:
5669
int lenConsumed =
TdsEnums
.SQLVARIANT_SIZE + cbPropsActual; // type, count of propBytes, and actual propBytes
5679
case
TdsEnums
.SQLBIT:
5680
case
TdsEnums
.SQLINT1:
5681
case
TdsEnums
.SQLINT2:
5682
case
TdsEnums
.SQLINT4:
5683
case
TdsEnums
.SQLINT8:
5684
case
TdsEnums
.SQLFLT4:
5685
case
TdsEnums
.SQLFLT8:
5686
case
TdsEnums
.SQLMONEY:
5687
case
TdsEnums
.SQLMONEY4:
5688
case
TdsEnums
.SQLDATETIME:
5689
case
TdsEnums
.SQLDATETIM4:
5690
case
TdsEnums
.SQLUNIQUEID:
5696
case
TdsEnums
.SQLDECIMALN:
5697
case
TdsEnums
.SQLNUMERICN:
5717
if (!TryReadSqlDecimal(value,
TdsEnums
.MAX_NUMERIC_LEN, precision, scale, stateObj)) {
5723
case
TdsEnums
.SQLBIGBINARY:
5724
case
TdsEnums
.SQLBIGVARBINARY:
5731
Debug.Assert(lenMax !=
TdsEnums
.SQL_USHORTVARMAXLEN, "bigvarbinary(max) in a sqlvariant");
5740
goto case
TdsEnums
.SQLBIT;
5742
case
TdsEnums
.SQLBIGCHAR:
5743
case
TdsEnums
.SQLBIGVARCHAR:
5744
case
TdsEnums
.SQLNCHAR:
5745
case
TdsEnums
.SQLNVARCHAR:
5757
Debug.Assert(lenMax !=
TdsEnums
.SQL_USHORTVARMAXLEN, "bigvarchar(max) or nvarchar(max) in a sqlvariant");
5772
case
TdsEnums
.SQLDATE:
5778
case
TdsEnums
.SQLTIME:
5779
case
TdsEnums
.SQLDATETIME2:
5780
case
TdsEnums
.SQLDATETIMEOFFSET:
5821
WriteInt(
TdsEnums
.FIXEDNULL, stateObj); //maxlen
5822
WriteInt(
TdsEnums
.FIXEDNULL, stateObj); //actuallen
5829
if ((
TdsEnums
.SQLNUMERICN == mt.TDSType) && (8 == length)) {
5844
WriteInt(
TdsEnums
.SQLVARIANT_SIZE + mt.PropBytes + length, stateObj); // maxLen
5845
WriteInt(
TdsEnums
.SQLVARIANT_SIZE + mt.PropBytes + length, stateObj); // actualLen
5853
case
TdsEnums
.SQLFLT4:
5857
case
TdsEnums
.SQLFLT8:
5861
case
TdsEnums
.SQLINT8:
5865
case
TdsEnums
.SQLINT4:
5869
case
TdsEnums
.SQLINT2:
5873
case
TdsEnums
.SQLINT1:
5877
case
TdsEnums
.SQLBIT:
5885
case
TdsEnums
.SQLBIGVARBINARY:
5893
case
TdsEnums
.SQLBIGVARCHAR:
5903
case
TdsEnums
.SQLUNIQUEID:
5913
case
TdsEnums
.SQLNVARCHAR:
5926
case
TdsEnums
.SQLDATETIME:
5935
case
TdsEnums
.SQLMONEY:
5941
case
TdsEnums
.SQLNUMERICN:
5949
case
TdsEnums
.SQLTIME:
5954
case
TdsEnums
.SQLDATETIMEOFFSET:
5985
WriteInt(
TdsEnums
.FIXEDNULL, stateObj);
5997
case
TdsEnums
.SQLFLT4:
6002
case
TdsEnums
.SQLFLT8:
6007
case
TdsEnums
.SQLINT8:
6012
case
TdsEnums
.SQLINT4:
6017
case
TdsEnums
.SQLINT2:
6022
case
TdsEnums
.SQLINT1:
6027
case
TdsEnums
.SQLBIT:
6036
case
TdsEnums
.SQLBIGVARBINARY:
6046
case
TdsEnums
.SQLBIGVARCHAR:
6058
case
TdsEnums
.SQLUNIQUEID:
6070
case
TdsEnums
.SQLNVARCHAR:
6085
case
TdsEnums
.SQLDATETIME:
6095
case
TdsEnums
.SQLMONEY:
6102
case
TdsEnums
.SQLNUMERICN:
6111
case
TdsEnums
.SQLTIME:
6117
case
TdsEnums
.SQLDATETIMEOFFSET:
6141
WriteSqlVariantHeader((int)(dateTime2MetaData.MaxLength + 3),
TdsEnums
.SQLDATETIME2, 1 /* one scale prop */, stateObj);
6150
WriteSqlVariantHeader((int)(dateMetaData.MaxLength + 2),
TdsEnums
.SQLDATE, 0 /* one scale prop */, stateObj);
6173
if (decimalValue <
TdsEnums
.SQL_SMALL_MONEY_MIN || decimalValue >
TdsEnums
.SQL_SMALL_MONEY_MAX) {
6198
if (value <
TdsEnums
.SQL_SMALL_MONEY_MIN || value >
TdsEnums
.SQL_SMALL_MONEY_MAX) {
6237
if (value <
TdsEnums
.SQL_SMALL_MONEY_MIN || value >
TdsEnums
.SQL_SMALL_MONEY_MAX) {
6264
long time = value.Ticks /
TdsEnums
.TICKS_FROM_SCALE[scale];
6267
time = time *
TdsEnums
.TICKS_FROM_SCALE[scale];
6268
length =
TdsEnums
.MAX_TIME_LENGTH;
6277
long time = value.Ticks /
TdsEnums
.TICKS_FROM_SCALE[scale];
6282
long time = value.TimeOfDay.Ticks /
TdsEnums
.TICKS_FROM_SCALE[scale]; // DateTime.TimeOfDay always returns a valid TimeSpan for Time
6285
time = time *
TdsEnums
.TICKS_FROM_SCALE[scale];
6286
length =
TdsEnums
.MAX_DATETIME2_LENGTH;
6303
long time = value.TimeOfDay.Ticks /
TdsEnums
.TICKS_FROM_SCALE[scale]; // DateTime.TimeOfDay always returns a valid TimeSpan for Time
6368
(length <=
TdsEnums
.MAX_NUMERIC_LEN - 1) &&
6744
Debug.Assert(colmeta.tdsType ==
TdsEnums
.SQLXMLTYPE ||
6745
colmeta.tdsType ==
TdsEnums
.SQLBIGVARCHAR ||
6746
colmeta.tdsType ==
TdsEnums
.SQLBIGVARBINARY ||
6747
colmeta.tdsType ==
TdsEnums
.SQLNVARCHAR ||
6749
colmeta.tdsType ==
TdsEnums
.SQLUDT,
6774
case
TdsEnums
.SQLFEATUREEXTACK:
6777
case
TdsEnums
.SQLSESSIONSTATE:
6778
case
TdsEnums
.SQLFEDAUTHINFO:
6783
if (token ==
TdsEnums
.SQLUDT) { // special case for UDTs
6787
else if (token ==
TdsEnums
.SQLRETURNVALUE) {
6791
else if (token ==
TdsEnums
.SQLXMLTYPE) {
6798
Debug.Assert(tokenLength ==
TdsEnums
.SQL_USHORTVARMAXLEN, "Invalid token stream for xml datatype");
6803
switch (token &
TdsEnums
.SQLLenMask) {
6804
case
TdsEnums
.SQLFixedLen:
6807
case
TdsEnums
.SQLZeroLen:
6810
case
TdsEnums
.SQLVarLen:
6811
case
TdsEnums
.SQLVarCnt:
6891
_physicalStateObj.WriteByte(
TdsEnums
.FEATUREEXT_SRECOVERY);
6977
Debug.Assert(fedAuthFeatureData.libraryType ==
TdsEnums
.FedAuthLibrary.ADAL || fedAuthFeatureData.libraryType ==
TdsEnums
.FedAuthLibrary.SecurityToken,
6985
case
TdsEnums
.FedAuthLibrary.ADAL:
6988
case
TdsEnums
.FedAuthLibrary.SecurityToken:
7001
_physicalStateObj.WriteByte(
TdsEnums
.FEATUREEXT_FEDAUTH);
7008
case
TdsEnums
.FedAuthLibrary.ADAL:
7010
options |=
TdsEnums
.FEDAUTHLIB_ADAL << 1;
7012
case
TdsEnums
.FedAuthLibrary.SecurityToken:
7014
options |=
TdsEnums
.FEDAUTHLIB_SECURITYTOKEN << 1;
7030
case
TdsEnums
.FedAuthLibrary.ADAL:
7034
workflow =
TdsEnums
.ADALWORKFLOW_ACTIVEDIRECTORYPASSWORD;
7037
workflow =
TdsEnums
.ADALWORKFLOW_ACTIVEDIRECTORYINTEGRATED;
7040
workflow =
TdsEnums
.ADALWORKFLOW_ACTIVEDIRECTORYINTERACTIVE;
7049
case
TdsEnums
.FedAuthLibrary.SecurityToken:
7066
_physicalStateObj.WriteByte(
TdsEnums
.FEATUREEXT_TCE);
7068
_physicalStateObj.WriteByte(
TdsEnums
.MAX_SUPPORTED_TCE_VERSION);
7079
_physicalStateObj.WriteByte(
TdsEnums
.FEATUREEXT_GLOBALTRANSACTIONS);
7092
_physicalStateObj.WriteByte(
TdsEnums
.FEATUREEXT_AZURESQLSUPPORT);
7105
TdsEnums
.FeatureExtension requestedFeatures,
7110
Debug.Assert(recoverySessionData == null || (requestedFeatures &
TdsEnums
.FeatureExtension.SessionRecovery) != 0, "Recovery session data without session recovery feature request");
7111
Debug.Assert(
TdsEnums
.MAXLEN_HOSTNAME>=rec.hostName.Length, "_workstationId.Length exceeds the max length for this value");
7114
Debug.Assert(!rec.useSSPI || (requestedFeatures &
TdsEnums
.FeatureExtension.FedAuth) == 0, "Cannot use both SSPI and FedAuth");
7115
Debug.Assert(fedAuthFeatureExtensionData == null || (requestedFeatures &
TdsEnums
.FeatureExtension.FedAuth) != 0, "fedAuthFeatureExtensionData provided without fed auth feature request");
7116
Debug.Assert(fedAuthFeatureExtensionData != null || (requestedFeatures &
TdsEnums
.FeatureExtension.FedAuth) == 0, "Fed Auth feature requested without specifying fedAuthFeatureExtensionData.");
7118
Debug.Assert(rec.userName == null || (rec.userName != null &&
TdsEnums
.MAXLEN_USERNAME >= rec.userName.Length), "_userID.Length exceeds the max length for this value");
7119
Debug.Assert(rec.credential == null || (rec.credential != null &&
TdsEnums
.MAXLEN_USERNAME >= rec.credential.UserId.Length), "_credential.UserId.Length exceeds the max length for this value");
7121
Debug.Assert(rec.password == null || (rec.password != null &&
TdsEnums
.MAXLEN_PASSWORD>=rec.password.Length), "_password.Length exceeds the max length for this value");
7122
Debug.Assert(rec.credential == null || (rec.credential != null &&
TdsEnums
.MAXLEN_PASSWORD >= rec.credential.Password.Length), "_credential.Password.Length exceeds the max length for this value");
7126
Debug.Assert(
TdsEnums
.MAXLEN_APPNAME>=rec.applicationName.Length, "_applicationName.Length exceeds the max length for this value");
7127
Debug.Assert(
TdsEnums
.MAXLEN_SERVERNAME>=rec.serverName.Length, "_dataSource.Length exceeds the max length for this value");
7128
Debug.Assert(
TdsEnums
.MAXLEN_LANGUAGE>=rec.language.Length, "_currentLanguage .Length exceeds the max length for this value");
7129
Debug.Assert(
TdsEnums
.MAXLEN_DATABASE>=rec.database.Length, "_initialCatalog.Length exceeds the max length for this value");
7130
Debug.Assert(
TdsEnums
.MAXLEN_ATTACHDBFILE>=rec.attachDBFilename.Length, "_attachDBFileName.Length exceeds the max length for this value");
7141
bool useFeatureExt = (requestedFeatures !=
TdsEnums
.FeatureExtension.None);
7165
_physicalStateObj._outputMessageType =
TdsEnums
.MT_LOGIN7;
7168
int length =
TdsEnums
.YUKON_LOG_REC_FIXED_LEN;
7170
string clientInterfaceName =
TdsEnums
.SQL_PROVIDER_NAME;
7171
Debug.Assert(
TdsEnums
.MAXLEN_CLIENTINTERFACE >= clientInterfaceName.Length, "cchCltIntName can specify at most 128 unicode characters. See Tds spec");
7223
if ((requestedFeatures &
TdsEnums
.FeatureExtension.SessionRecovery) != 0) {
7226
if ((requestedFeatures &
TdsEnums
.FeatureExtension.FedAuth) != 0) {
7230
if ((requestedFeatures &
TdsEnums
.FeatureExtension.Tce) != 0) {
7233
if ((requestedFeatures &
TdsEnums
.FeatureExtension.GlobalTransactions) != 0) {
7236
if ((requestedFeatures &
TdsEnums
.FeatureExtension.AzureSQLSupport) != 0) {
7246
WriteInt((
TdsEnums
.DENALI_MAJOR << 24) | (
TdsEnums
.DENALI_INCREMENT << 16) |
TdsEnums
.DENALI_MINOR, _physicalStateObj);
7252
WriteInt(
TdsEnums
.CLIENT_PROG_VER, _physicalStateObj);
7286
log7Flags |=
TdsEnums
.USE_DB_ON << 5;
7287
log7Flags |=
TdsEnums
.INIT_DB_FATAL << 6;
7288
log7Flags |=
TdsEnums
.SET_LANG_ON << 7;
7291
log7Flags |=
TdsEnums
.INIT_LANG_FATAL << 8;
7292
log7Flags |=
TdsEnums
.ODBC_ON << 9;
7294
log7Flags |=
TdsEnums
.REPL_ON << 12;
7297
log7Flags |=
TdsEnums
.SSPI_ON << 15;
7302
log7Flags |=
TdsEnums
.READONLY_INTENT_ON << 21; // read-only intent flag is a first bit of fSpare1
7326
int offset =
TdsEnums
.YUKON_LOG_REC_FIXED_LEN;
7459
if ((requestedFeatures &
TdsEnums
.FeatureExtension.SessionRecovery) != 0) {
7462
if ((requestedFeatures &
TdsEnums
.FeatureExtension.FedAuth) != 0) {
7467
if ((requestedFeatures &
TdsEnums
.FeatureExtension.Tce) != 0) {
7470
if ((requestedFeatures &
TdsEnums
.FeatureExtension.GlobalTransactions) != 0) {
7473
if ((requestedFeatures &
TdsEnums
.FeatureExtension.AzureSQLSupport) != 0) {
7490
_physicalStateObj.WritePacket(
TdsEnums
.HARDFLUSH);
7507
_physicalStateObj._outputMessageType =
TdsEnums
.MT_FEDAUTH;
7521
_physicalStateObj.WritePacket(
TdsEnums
.HARDFLUSH);
7542
SSPIError(SQLMessage.SSPIGenerateError(),
TdsEnums
.GEN_CLIENT_CONTEXT);
7569
_physicalStateObj._outputMessageType =
TdsEnums
.MT_SSPI;
7572
_physicalStateObj.WritePacket(
TdsEnums
.HARDFLUSH);
7580
_physicalStateObj.AddError(new SqlError(0, (byte)0x00, (byte)
TdsEnums
.MIN_ERROR_CLASS, _server, error, procedure, 0));
7593
SSPIError(SQLMessage.SSPIInitializeError(),
TdsEnums
.INIT_SSPI_PACKAGE);
7631
_physicalStateObj.AddError(new SqlError(0, (byte)0x00, (byte)
TdsEnums
.MIN_ERROR_CLASS, _server, Res.GetString(Res.SQL_ADALInitializeError, authentication.ToString("G"), result.ToString("X")),
TdsEnums
.INIT_ADAL_PACKAGE, 0));
7648
TdsEnums
.TransactionManagerRequestType.GetDTCAddress,
7650
TdsEnums
.TransactionManagerIsolationLevel.Unspecified,
7687
TdsEnums
.TransactionManagerRequestType.Propagate, null,
7688
TdsEnums
.TransactionManagerIsolationLevel.Unspecified, timeout, null, stateObj, true);
7693
TdsEnums
.TransactionManagerRequestType request,
7695
TdsEnums
.TransactionManagerIsolationLevel isoLevel,
7736
stateObj._outputMessageType =
TdsEnums
.MT_TRANS; // set message type
7757
case
TdsEnums
.TransactionManagerRequestType.GetDTCAddress:
7762
case
TdsEnums
.TransactionManagerRequestType.Propagate:
7771
case
TdsEnums
.TransactionManagerRequestType.Begin:
7799
case
TdsEnums
.TransactionManagerRequestType.Promote:
7805
case
TdsEnums
.TransactionManagerRequestType.Commit:
7813
Debug.Assert(isoLevel ==
TdsEnums
.TransactionManagerIsolationLevel.Unspecified, "Should not have isolation level other than unspecified on Commit!");
7817
case
TdsEnums
.TransactionManagerRequestType.Rollback:
7825
Debug.Assert(isoLevel ==
TdsEnums
.TransactionManagerIsolationLevel.Unspecified, "Should not have isolation level other than unspecified on Commit!");
7829
case
TdsEnums
.TransactionManagerRequestType.Save:
7840
Task writeTask = stateObj.WritePacket(
TdsEnums
.HARDFLUSH);
7864
if (((request ==
TdsEnums
.TransactionManagerRequestType.Begin) || (request ==
TdsEnums
.TransactionManagerRequestType.Propagate)) && ((transaction == null) || (transaction.TransactionId != _retainedTransactionId))) {
7988
stateObj._outputMessageType =
TdsEnums
.MT_SQL;
8098
stateObj._outputMessageType =
TdsEnums
.MT_RPC;
8157
WriteSmiParameter(param, i, 0 != (rpcext.paramoptions[i] &
TdsEnums
.RPC_PARAM_DEFAULT), stateObj);
8196
if (mt.TDSType !=
TdsEnums
.SQLUDT)
8211
if (precision >
TdsEnums
.MAX_NUMERIC_PRECISION) {
8242
bool isParameterEncrypted = 0 != (rpcext.paramoptions[i] &
TdsEnums
.RPC_PARAM_ENCRYPTED);
8249
Debug.Assert(mt.TDSType !=
TdsEnums
.SQLVARIANT &&
8250
mt.TDSType !=
TdsEnums
.SQLUDT &&
8251
mt.TDSType !=
TdsEnums
.SQLXMLTYPE &&
8252
mt.TDSType !=
TdsEnums
.SQLIMAGE &&
8253
mt.TDSType !=
TdsEnums
.SQLTEXT &&
8254
mt.TDSType !=
TdsEnums
.SQLNTEXT, "Type unsupported for encryption");
8315
if (mt.TDSType ==
TdsEnums
.SQLVARIANT) {
8347
WriteShort(
TdsEnums
.SQL_USHORTVARMAXLEN, stateObj);
8371
WriteParameterVarLen(mt,
TdsEnums
.TEXT_TIME_STAMP_LEN, false, stateObj);
8399
if (!ADP.IsEmpty(names[0]) &&
TdsEnums
.MAX_SERVERNAME < names[0].Length) {
8402
if (!ADP.IsEmpty(names[1]) &&
TdsEnums
.MAX_SERVERNAME < names[names.Length - 2].Length) {
8405
if (
TdsEnums
.MAX_SERVERNAME < names[2].Length) {
8421
WriteUnsignedLong(
TdsEnums
.SQL_PLP_NULL, stateObj); // PLP Null.
8428
WriteShort(
TdsEnums
.SQL_USHORTVARMAXLEN, stateObj);
8448
stateObj.WriteByte(
TdsEnums
.DEFAULT_NUMERIC_PRECISION);
8450
stateObj.WriteByte(
TdsEnums
.SPHINX_DEFAULT_NUMERIC_PRECISION);
8571
stateObj.WriteByte(
TdsEnums
.YUKON_RPCBATCHFLAG);
8575
stateObj.WriteByte(
TdsEnums
.SHILOH_RPCBATCHFLAG);
8636
if (TceVersionSupported >=
TdsEnums
.MIN_TCE_VERSION_WITH_ENCLAVE_SUPPORT) {
8835
status |=
TdsEnums
.RPC_PARAM_BYREF;
8839
status |=
TdsEnums
.RPC_PARAM_DEFAULT;
8853
stateObj.WriteByte(
TdsEnums
.SQLINTN);
8857
stateObj.WriteByte(
TdsEnums
.SQLBIGBINARY);
8861
stateObj.WriteByte(
TdsEnums
.SQLBITN);
8865
stateObj.WriteByte(
TdsEnums
.SQLBIGCHAR);
8871
stateObj.WriteByte(
TdsEnums
.SQLDATETIMN);
8875
stateObj.WriteByte(
TdsEnums
.SQLNUMERICN);
8881
stateObj.WriteByte(
TdsEnums
.SQLFLTN);
8885
stateObj.WriteByte(
TdsEnums
.SQLBIGVARBINARY);
8889
stateObj.WriteByte(
TdsEnums
.SQLINTN);
8893
stateObj.WriteByte(
TdsEnums
.SQLMONEYN);
8897
stateObj.WriteByte(
TdsEnums
.SQLNCHAR);
8903
stateObj.WriteByte(
TdsEnums
.SQLNVARCHAR);
8909
stateObj.WriteByte(
TdsEnums
.SQLNVARCHAR);
8920
stateObj.WriteByte(
TdsEnums
.SQLFLTN);
8924
stateObj.WriteByte(
TdsEnums
.SQLUNIQUEID);
8928
stateObj.WriteByte(
TdsEnums
.SQLDATETIMN);
8932
stateObj.WriteByte(
TdsEnums
.SQLINTN);
8936
stateObj.WriteByte(
TdsEnums
.SQLMONEYN);
8940
stateObj.WriteByte(
TdsEnums
.SQLBIGVARCHAR);
8946
stateObj.WriteByte(
TdsEnums
.SQLBIGBINARY);
8950
stateObj.WriteByte(
TdsEnums
.SQLINTN);
8954
stateObj.WriteByte(
TdsEnums
.SQLBIGVARBINARY);
8958
stateObj.WriteByte(
TdsEnums
.SQLBIGVARCHAR);
8964
stateObj.WriteByte(
TdsEnums
.SQLVARIANT);
8968
stateObj.WriteByte(
TdsEnums
.SQLXMLTYPE);
8982
stateObj.WriteByte(
TdsEnums
.SQLUDT);
8996
stateObj.WriteByte(
TdsEnums
.SQLDATE);
8999
stateObj.WriteByte(
TdsEnums
.SQLTIME);
9003
stateObj.WriteByte(
TdsEnums
.SQLDATETIME2);
9007
stateObj.WriteByte(
TdsEnums
.SQLDATETIMEOFFSET);
9020
stateObj.WriteByte((byte)
TdsEnums
.SQLTABLE);
9029
WriteUnsignedShort((ushort)
TdsEnums
.TVP_NOMETADATA_TOKEN, stateObj);
9047
stateObj.WriteByte(
TdsEnums
.TVP_END_TOKEN);
9054
WriteUnsignedInt(
TdsEnums
.SQLTIMESTAMP, stateObj);
9060
ushort status =
TdsEnums
.Nullable;
9062
status |=
TdsEnums
.TVP_DEFAULT_COLUMN;
9102
flags =
TdsEnums
.TVP_ORDERASC_FLAG;
9105
flags =
TdsEnums
.TVP_ORDERDESC_FLAG;
9110
flags |=
TdsEnums
.TVP_UNIQUE_FLAG;
9121
stateObj.WriteByte(
TdsEnums
.TVP_ORDER_UNIQUE_TOKEN);
9136
stateObj.WriteByte(
TdsEnums
.SQLDONE);
9143
return stateObj.WritePacket(
TdsEnums
.HARDFLUSH);
9272
if (
TdsEnums
.CustomCipherAlgorithmId == md.cipherMD.CipherAlgorithmId) {
9291
stateObj.WriteByte(
TdsEnums
.SQLCOLMETADATA);
9312
flags |= (UInt16)(md.isNullable ? (UInt16)
TdsEnums
.Nullable : (UInt16)0);
9313
flags |= (UInt16)(md.isIdentity ? (UInt16)
TdsEnums
.Identity : (UInt16)0);
9318
flags |= (UInt16)(md.isEncrypted ? (UInt16)(
TdsEnums
.IsEncrypted << 8) : (UInt16)0);
9341
stateObj.WriteByte(
TdsEnums
.SQLBIGVARBINARY);
9342
WriteTokenLength(
TdsEnums
.SQLBIGVARBINARY, md.length, stateObj);
9404
case
TdsEnums
.SQLBIGBINARY:
9405
case
TdsEnums
.SQLBIGVARBINARY:
9406
case
TdsEnums
.SQLIMAGE:
9423
case
TdsEnums
.SQLUNIQUEID:
9426
case
TdsEnums
.SQLBIGCHAR:
9427
case
TdsEnums
.SQLBIGVARCHAR:
9428
case
TdsEnums
.SQLTEXT:
9444
case
TdsEnums
.SQLNCHAR:
9445
case
TdsEnums
.SQLNVARCHAR:
9446
case
TdsEnums
.SQLNTEXT:
9519
if (metatype.IsPlp && (metatype.NullableType !=
TdsEnums
.SQLUDT || metatype.IsLong)) {
9520
WriteLong(unchecked((long)
TdsEnums
.SQL_PLP_NULL), stateObj);
9523
WriteShort(
TdsEnums
.VARNULL, stateObj);
9526
stateObj.WriteByte(
TdsEnums
.FIXEDNULL);
9533
case
TdsEnums
.SQLBIGBINARY:
9534
case
TdsEnums
.SQLBIGVARBINARY:
9535
case
TdsEnums
.SQLIMAGE:
9536
case
TdsEnums
.SQLUDT:
9539
case
TdsEnums
.SQLUNIQUEID:
9542
case
TdsEnums
.SQLBIGCHAR:
9543
case
TdsEnums
.SQLBIGVARCHAR:
9544
case
TdsEnums
.SQLTEXT:
9560
case
TdsEnums
.SQLNCHAR:
9561
case
TdsEnums
.SQLNVARCHAR:
9562
case
TdsEnums
.SQLNTEXT:
9565
case
TdsEnums
.SQLXMLTYPE:
9604
WriteUnsignedLong(
TdsEnums
.SQL_PLP_UNKNOWNLEN, stateObj);
9670
WriteShort(
TdsEnums
.HEADERTYPE_MARS, stateObj);
9749
WriteShort(
TdsEnums
.HEADERTYPE_QNOTIFICATION, stateObj); // Query notifications Type
9768
WriteShort(
TdsEnums
.HEADERTYPE_TRACE, stateObj); // Trace Header Type
9839
if (
TdsEnums
.SQLUDT == token) {
9842
else if (token ==
TdsEnums
.SQLXMLTYPE) {
9848
switch (token &
TdsEnums
.SQLLenMask) {
9849
case
TdsEnums
.SQLFixedLen:
9854
case
TdsEnums
.SQLZeroLen:
9858
case
TdsEnums
.SQLVarLen:
9859
case
TdsEnums
.SQLVarCnt:
9892
WriteShort(
TdsEnums
.SQL_USHORTVARMAXLEN, stateObj);
9900
if (type.NullableType ==
TdsEnums
.SQLXMLTYPE) {
9951
Debug.Assert(((type.NullableType ==
TdsEnums
.SQLXMLTYPE) ||
9957
case
TdsEnums
.SQLFLTN:
9967
case
TdsEnums
.SQLBIGBINARY:
9968
case
TdsEnums
.SQLBIGVARBINARY:
9969
case
TdsEnums
.SQLIMAGE:
9984
case
TdsEnums
.SQLUNIQUEID:
9993
case
TdsEnums
.SQLBITN:
10004
case
TdsEnums
.SQLINTN:
10020
case
TdsEnums
.SQLBIGCHAR:
10021
case
TdsEnums
.SQLBIGVARCHAR:
10022
case
TdsEnums
.SQLTEXT:
10037
case
TdsEnums
.SQLNCHAR:
10038
case
TdsEnums
.SQLNVARCHAR:
10039
case
TdsEnums
.SQLNTEXT:
10040
case
TdsEnums
.SQLXMLTYPE:
10045
WriteShort(
TdsEnums
.XMLUNICODEBOM , stateObj);
10064
case
TdsEnums
.SQLNUMERICN:
10069
case
TdsEnums
.SQLDATETIMN:
10086
case
TdsEnums
.SQLMONEYN:
10092
case
TdsEnums
.SQLUDT:
10414
await writer.WriteAsync((char)
TdsEnums
.XMLUNICODEBOM).ConfigureAwait(false);
10417
writer.Write((char)
TdsEnums
.XMLUNICODEBOM);
10518
case
TdsEnums
.SQLFLTN:
10528
case
TdsEnums
.SQLBIGBINARY:
10529
case
TdsEnums
.SQLBIGVARBINARY:
10530
case
TdsEnums
.SQLIMAGE:
10531
case
TdsEnums
.SQLUDT: {
10549
case
TdsEnums
.SQLUNIQUEID: {
10558
case
TdsEnums
.SQLBITN: {
10568
case
TdsEnums
.SQLINTN:
10582
case
TdsEnums
.SQLBIGCHAR:
10583
case
TdsEnums
.SQLBIGVARCHAR:
10584
case
TdsEnums
.SQLTEXT: {
10610
case
TdsEnums
.SQLNCHAR:
10611
case
TdsEnums
.SQLNVARCHAR:
10612
case
TdsEnums
.SQLNTEXT:
10613
case
TdsEnums
.SQLXMLTYPE: {
10631
WriteShort(
TdsEnums
.XMLUNICODEBOM, stateObj);
10647
case
TdsEnums
.SQLNUMERICN:
10652
case
TdsEnums
.SQLDATETIMN:
10671
case
TdsEnums
.SQLMONEYN: {
10676
case
TdsEnums
.SQLDATE: {
10681
case
TdsEnums
.SQLTIME:
10682
if (scale >
TdsEnums
.DEFAULT_VARTIME_SCALE) {
10688
case
TdsEnums
.SQLDATETIME2:
10689
if (scale >
TdsEnums
.DEFAULT_VARTIME_SCALE) {
10695
case
TdsEnums
.SQLDATETIMEOFFSET:
10755
case
TdsEnums
.SQLFLTN:
10763
case
TdsEnums
.SQLBIGBINARY:
10764
case
TdsEnums
.SQLBIGVARBINARY:
10765
case
TdsEnums
.SQLIMAGE:
10766
case
TdsEnums
.SQLUDT: {
10775
case
TdsEnums
.SQLUNIQUEID: {
10783
case
TdsEnums
.SQLBITN: {
10790
case
TdsEnums
.SQLINTN:
10803
case
TdsEnums
.SQLBIGCHAR:
10804
case
TdsEnums
.SQLBIGVARCHAR:
10805
case
TdsEnums
.SQLTEXT: {
10818
case
TdsEnums
.SQLNCHAR:
10819
case
TdsEnums
.SQLNVARCHAR:
10820
case
TdsEnums
.SQLNTEXT:
10821
case
TdsEnums
.SQLXMLTYPE: {
10835
case
TdsEnums
.SQLNUMERICN:
10839
case
TdsEnums
.SQLDATETIMN:
10881
case
TdsEnums
.SQLMONEYN: {
10885
case
TdsEnums
.SQLDATE: {
10889
case
TdsEnums
.SQLTIME:
10890
if (scale >
TdsEnums
.DEFAULT_VARTIME_SCALE) {
10895
case
TdsEnums
.SQLDATETIME2:
10896
if (scale >
TdsEnums
.DEFAULT_VARTIME_SCALE) {
10901
case
TdsEnums
.SQLDATETIMEOFFSET:
10902
if (scale >
TdsEnums
.DEFAULT_VARTIME_SCALE) {
10916
Debug.Assert(((type.NullableType ==
TdsEnums
.SQLXMLTYPE) ||
10926
case
TdsEnums
.SQLFLTN:
10934
case
TdsEnums
.SQLBIGBINARY:
10935
case
TdsEnums
.SQLBIGVARBINARY:
10936
case
TdsEnums
.SQLIMAGE: {
10949
case
TdsEnums
.SQLUNIQUEID: {
10956
case
TdsEnums
.SQLBITN: {
10963
case
TdsEnums
.SQLINTN:
10978
case
TdsEnums
.SQLBIGCHAR:
10979
case
TdsEnums
.SQLBIGVARCHAR:
10980
case
TdsEnums
.SQLTEXT:
10991
case
TdsEnums
.SQLNCHAR:
10992
case
TdsEnums
.SQLNVARCHAR:
10993
case
TdsEnums
.SQLNTEXT:
10994
case
TdsEnums
.SQLXMLTYPE:
11008
case
TdsEnums
.SQLNUMERICN:
11012
case
TdsEnums
.SQLDATETIMN:
11053
case
TdsEnums
.SQLMONEYN: {
11070
WriteLong(unchecked((long)
TdsEnums
.SQL_PLP_NULL), stateObj);
11073
WriteInt(unchecked((int)
TdsEnums
.VARLONGNULL), stateObj);
11076
else if (type.NullableType ==
TdsEnums
.SQLXMLTYPE || unknownLength) {
11077
WriteUnsignedLong(
TdsEnums
.SQL_PLP_UNKNOWNLEN, stateObj);
11089
stateObj.WriteByte(
TdsEnums
.FIXEDNULL);
11097
WriteShort(
TdsEnums
.VARNULL, stateObj);
11105
stateObj.WriteByte(
TdsEnums
.FIXEDNULL);
11122
Debug.Assert((stateObj._longlen != 0) && (stateObj._longlen !=
TdsEnums
.SQL_PLP_NULL),
11169
Debug.Assert(((ulong)stateObj._longlen !=
TdsEnums
.SQL_PLP_NULL),
11176
if (buff == null && stateObj._longlen !=
TdsEnums
.SQL_PLP_UNKNOWNLEN) {
11260
Debug.Assert(((ulong)stateObj._longlen !=
TdsEnums
.SQL_PLP_NULL),
11380
if (stateObj._longlen ==
TdsEnums
.SQL_PLP_UNKNOWNLEN)
11382
else if (stateObj._longlen ==
TdsEnums
.SQL_PLP_NULL)
fx\src\data\System\Data\SqlClient\TdsParserHelperClasses.cs (4)
75
internal
TdsEnums
.FedAuthLibrary libraryType;
821
internal byte precision =
TdsEnums
.UNKNOWN_PRECISION_SCALE; // give default of unknown (-1)
822
internal byte scale =
TdsEnums
.UNKNOWN_PRECISION_SCALE; // give default of unknown (-1)
1059
if (
TdsEnums
.RPC_PROCID_EXECUTESQL == ProcID) {
fx\src\data\System\Data\SqlClient\TdsParserSafeHandles.cs (4)
28
private readonly UInt32 _sniStatus =
TdsEnums
.SNI_UNINITIALIZED;
43
if (
TdsEnums
.SNI_SUCCESS == _sniStatus) {
62
if (
TdsEnums
.SNI_SUCCESS == _sniStatus) {
122
private readonly UInt32 _status =
TdsEnums
.SNI_UNINITIALIZED;
fx\src\data\System\Data\SqlClient\TdsParserStateObject.cs (59)
65
internal readonly int _inputHeaderLen =
TdsEnums
.HEADER_LEN;
66
internal readonly int _outputHeaderLen =
TdsEnums
.HEADER_LEN;
70
internal int _outBytesUsed =
TdsEnums
.HEADER_LEN; // number of bytes used in internal write buffer -
149
internal byte[] _bTmp = new byte[
TdsEnums
.YUKON_HEADER_LEN]; // Scratch buffer for misc use
162
private byte[] _partialHeaderBuffer = new byte[
TdsEnums
.HEADER_LEN]; // Scratch buffer for ProcessHeader
274
SetPacketSize(
TdsEnums
.DEFAULT_LOGIN_PACKET_SIZE);
300
if (_sessionHandle.Status !=
TdsEnums
.SNI_SUCCESS) {
406
return
TdsEnums
.SNI_UNINITIALIZED;
473
if (_inBuff[_inBytesUsed] ==
TdsEnums
.SQLROW) {
477
else if (_inBuff[_inBytesUsed] ==
TdsEnums
.SQLNBCROW) {
659
if (callbackType == CallbackType.Read &&
TdsEnums
.SNI_SUCCESS == error) {
670
if (
TdsEnums
.SNI_SUCCESS != error) {
961
Task writePacketTask = WritePacket(
TdsEnums
.HARDFLUSH);
996
_inBytesPacket = ((int)_partialHeaderBuffer[
TdsEnums
.HEADER_LEN_FIELD_OFFSET] << 8 |
997
(int)_partialHeaderBuffer[
TdsEnums
.HEADER_LEN_FIELD_OFFSET + 1]) - _inputHeaderLen;
1030
_inBytesPacket = ((int)_inBuff[_inBytesUsed +
TdsEnums
.HEADER_LEN_FIELD_OFFSET] << 8 |
1031
(int)_inBuff[_inBytesUsed +
TdsEnums
.HEADER_LEN_FIELD_OFFSET + 1]) - _inputHeaderLen;
1108
if (size >
TdsEnums
.MAX_PACKET_SIZE) {
1700
if (_longlen ==
TdsEnums
.SQL_PLP_NULL) {
1711
if (chunklen ==
TdsEnums
.SQL_PLP_CHUNK_TERMINATOR) {
1723
lengthLeft =
TdsEnums
.SQL_PLP_NULL;
1766
Debug.Assert((_longlen !=
TdsEnums
.SQL_PLP_NULL),
1773
if (buff == null && _longlen !=
TdsEnums
.SQL_PLP_UNKNOWNLEN) {
1966
if (
TdsEnums
.SNI_SUCCESS == error) { // Success - process results!
2035
AddError(new SqlError(
TdsEnums
.TIMEOUT_EXPIRED, (byte)0x00,
TdsEnums
.MIN_ERROR_CLASS, _parser.Server, _parser.Connection.TimeoutErrorInternal.GetErrorMessage(), "", 0,
TdsEnums
.SNI_WAIT_TIMEOUT));
2165
if (!(
TdsEnums
.SNI_SUCCESS == error ||
TdsEnums
.SNI_SUCCESS_IO_PENDING == error)) {
2177
if (
TdsEnums
.SNI_SUCCESS == error) { // Success - process results!
2181
else if (
TdsEnums
.SNI_SUCCESS_IO_PENDING != error) { // FAILURE!
2249
if ((error !=
TdsEnums
.SNI_SUCCESS) && (error !=
TdsEnums
.SNI_WAIT_TIMEOUT)) {
2291
UInt32 error=
TdsEnums
.SNI_SUCCESS;
2303
return (error ==
TdsEnums
.SNI_SUCCESS) || (error ==
TdsEnums
.SNI_WAIT_TIMEOUT);
2310
if (
TdsEnums
.SNI_WAIT_TIMEOUT == error) {
2320
AddError(new SqlError(
TdsEnums
.TIMEOUT_EXPIRED, (byte)0x00,
TdsEnums
.MIN_ERROR_CLASS, _parser.Server, _parser.Connection.TimeoutErrorInternal.GetErrorMessage(), "", 0,
TdsEnums
.SNI_WAIT_TIMEOUT));
2343
if (
TdsEnums
.SNI_SUCCESS == error) {
2411
if (getDataError ==
TdsEnums
.SNI_SUCCESS) {
2562
if (sniError !=
TdsEnums
.SNI_SUCCESS) {
2716
WritePacket(
TdsEnums
.SOFTFLUSH, canAccumulate:true);
2760
Task packetTask = WritePacket(
TdsEnums
.SOFTFLUSH, canAccumulate);
2829
status =
TdsEnums
.ST_EOM |
TdsEnums
.ST_IGNORE;
2832
else if (
TdsEnums
.HARDFLUSH == flushMode) {
2833
status =
TdsEnums
.ST_EOM;
2836
else if (
TdsEnums
.SOFTFLUSH==flushMode) {
2837
status =
TdsEnums
.ST_BATCH;
2841
status =
TdsEnums
.ST_EOM;
2921
if (sniError ==
TdsEnums
.SNI_SUCCESS_IO_PENDING) {
2978
if (sniError ==
TdsEnums
.SNI_SUCCESS) {
3012
SNINativeMethodWrapper.SNIPacketSetData(attnPacket, SQL.AttentionHeader,
TdsEnums
.HEADER_LEN, null, null);
3084
AddError(new SqlError(
TdsEnums
.TIMEOUT_EXPIRED, (byte)0x00,
TdsEnums
.MIN_ERROR_CLASS, _parser.Server, _parser.Connection.TimeoutErrorInternal.GetErrorMessage(), "", 0,
TdsEnums
.SNI_WAIT_TIMEOUT));
3396
broken |= (error.Class >=
TdsEnums
.FATAL_ERROR_CLASS);
fx\src\data\System\Data\SqlClient\TdsParserStaticMethods.cs (1)
159
nicAddress = new byte[
TdsEnums
.MAX_NIC_SIZE];
fx\src\data\System\Data\SqlClient\TdsRecordBufferSetter.cs (2)
205
_stateObj.WriteByte(
TdsEnums
.TVP_ROW_TOKEN);
218
_stateObj.WriteByte(
TdsEnums
.TVP_END_TOKEN);
fx\src\data\System\Data\SqlClient\TdsValueSetter.cs (30)
63
_stateObj.Parser.WriteUnsignedLong(
TdsEnums
.SQL_PLP_NULL, _stateObj);
84
_stateObj.WriteByte(
TdsEnums
.FIXEDNULL);
96
_stateObj.Parser.WriteShort(
TdsEnums
.VARNULL, _stateObj);
103
_stateObj.Parser.WriteInt(
TdsEnums
.FIXEDNULL, _stateObj);
120
_stateObj.Parser.WriteSqlVariantHeader(3,
TdsEnums
.SQLBIT, 0, _stateObj);
138
_stateObj.Parser.WriteSqlVariantHeader(3,
TdsEnums
.SQLINT1, 0, _stateObj);
165
_stateObj.Parser.WriteUnsignedLong(
TdsEnums
.SQL_PLP_UNKNOWNLEN, _stateObj);
183
_stateObj.Parser.WriteSqlVariantHeader(4 + length,
TdsEnums
.SQLBIGVARBINARY, 2, _stateObj);
207
_stateObj.Parser.WriteSqlVariantHeader(4,
TdsEnums
.SQLBIGVARBINARY, 2, _stateObj);
213
_stateObj.Parser.WriteInt(
TdsEnums
.SQL_PLP_CHUNK_TERMINATOR, _stateObj);
248
_stateObj.Parser.WriteUnsignedLong(
TdsEnums
.SQL_PLP_UNKNOWNLEN, _stateObj);
299
_stateObj.Parser.WriteInt(
TdsEnums
.SQL_PLP_CHUNK_TERMINATOR, _stateObj);
336
if (length * ADP.CharSize >
TdsEnums
.TYPE_SIZE_LIMIT) { // send as varchar for length greater than 4000
345
_stateObj.Parser.WriteSqlVariantHeader(9 + bytes.Length,
TdsEnums
.SQLBIGVARCHAR, 7, _stateObj);
352
_stateObj.Parser.WriteSqlVariantHeader(9 + length * ADP.CharSize,
TdsEnums
.SQLNVARCHAR, 7, _stateObj);
366
_stateObj.Parser.WriteInt(
TdsEnums
.SQL_PLP_CHUNK_TERMINATOR, _stateObj); // Terminator
381
_stateObj.Parser.WriteSqlVariantHeader(4,
TdsEnums
.SQLINT2, 0, _stateObj);
394
_stateObj.Parser.WriteSqlVariantHeader(6,
TdsEnums
.SQLINT4, 0, _stateObj);
408
_stateObj.Parser.WriteSqlVariantHeader(10,
TdsEnums
.SQLINT8, 0, _stateObj);
414
_stateObj.Parser.WriteSqlVariantHeader(10,
TdsEnums
.SQLMONEY, 0, _stateObj);
440
_stateObj.Parser.WriteSqlVariantHeader(6,
TdsEnums
.SQLFLT4, 0, _stateObj);
453
_stateObj.Parser.WriteSqlVariantHeader(10,
TdsEnums
.SQLFLT8, 0, _stateObj);
466
_stateObj.Parser.WriteSqlVariantHeader(21,
TdsEnums
.SQLNUMERICN, 2, _stateObj);
493
_stateObj.Parser.WriteSqlVariantHeader(10,
TdsEnums
.SQLDATETIME, 0, _stateObj);
518
Int64 time = value.TimeOfDay.Ticks /
TdsEnums
.TICKS_FROM_SCALE[_metaData.Scale];
535
_stateObj.Parser.WriteSqlVariantHeader(18,
TdsEnums
.SQLUNIQUEID, 0, _stateObj);
554
_stateObj.Parser.WriteSqlVariantHeader(8,
TdsEnums
.SQLTIME, 1, _stateObj);
561
Int64 time = value.Ticks /
TdsEnums
.TICKS_FROM_SCALE[scale];
577
_stateObj.Parser.WriteSqlVariantHeader(13,
TdsEnums
.SQLDATETIMEOFFSET, 1, _stateObj);
585
Int64 time = utcDateTime.TimeOfDay.Ticks /
TdsEnums
.TICKS_FROM_SCALE[scale];