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