2295 references to SqlDbType
System.Activities.DurableInstancing (89)
System\Activities\DurableInstancing\CreateWorkflowOwnerAsyncResult.cs (12)
88parameters.Add(new SqlParameter { ParameterName = "@lockTimeout", SqlDbType = SqlDbType.Int, Value = lockTimeout }); 89parameters.Add(new SqlParameter { ParameterName = "@lockOwnerId", SqlDbType = SqlDbType.UniqueIdentifier, Value = this.lockOwnerId }); 90parameters.Add(new SqlParameter { ParameterName = "@workflowHostType", SqlDbType = SqlDbType.UniqueIdentifier, Value = (base.Store.WorkflowHostType != Guid.Empty) ? base.Store.WorkflowHostType : (object) DBNull.Value }); 91parameters.Add(new SqlParameter { ParameterName = "@enqueueCommand", SqlDbType = SqlDbType.Bit, Value = base.Store.EnqueueRunCommands }); 92parameters.Add(new SqlParameter { ParameterName = "@deleteInstanceOnCompletion", SqlDbType = SqlDbType.Bit, Value = (base.Store.InstanceCompletionAction == InstanceCompletionAction.DeleteAll) }); 93parameters.Add(new SqlParameter { ParameterName = "@primitiveLockOwnerData", SqlDbType = SqlDbType.VarBinary, Size = properties[0].Count, Value = (object)(properties[0].Array) ?? DBNull.Value }); 94parameters.Add(new SqlParameter { ParameterName = "@complexLockOwnerData", SqlDbType = SqlDbType.VarBinary, Size = properties[1].Count, Value = (object)(properties[1].Array) ?? DBNull.Value }); 95parameters.Add(new SqlParameter { ParameterName = "@writeOnlyPrimitiveLockOwnerData", SqlDbType = SqlDbType.VarBinary, Size = properties[2].Count, Value = (object)(properties[2].Array) ?? DBNull.Value }); 96parameters.Add(new SqlParameter { ParameterName = "@writeOnlyComplexLockOwnerData", SqlDbType = SqlDbType.VarBinary, Size = properties[3].Count, Value = (object)(properties[3].Array) ?? DBNull.Value }); 97parameters.Add(new SqlParameter { ParameterName = "@encodingOption", SqlDbType = SqlDbType.TinyInt, Value = base.Store.InstanceEncodingOption }); 98parameters.Add(new SqlParameter { ParameterName = "@machineName", SqlDbType = SqlDbType.NVarChar, Value = SqlWorkflowInstanceStoreConstants.MachineName }); 105parameters.Add(new SqlParameter { ParameterName = "@identityMetadata", SqlDbType = SqlDbType.Xml, Value = identityMetadataXml });
System\Activities\DurableInstancing\DeleteWorkflowOwnerAsyncResult.cs (1)
37sqlCommand.Parameters.Add(new SqlParameter { ParameterName = "@surrogateLockOwnerId", SqlDbType = SqlDbType.BigInt, Value = this.surrogateLockOwnerId });
System\Activities\DurableInstancing\DetectActivatableWorkflowsAsyncResult.cs (1)
46sqlCommand.Parameters.Add(new SqlParameter { ParameterName = "@machineName", SqlDbType = SqlDbType.NVarChar, Value = SqlWorkflowInstanceStoreConstants.MachineName });
System\Activities\DurableInstancing\DetectRunnableInstancesAsyncResult.cs (2)
46sqlCommand.Parameters.Add(new SqlParameter { ParameterName = "@workflowHostType", SqlDbType = SqlDbType.UniqueIdentifier, Value = base.Store.WorkflowHostType }); 49sqlCommand.Parameters.Add(new SqlParameter { ParameterName = "@surrogateLockOwnerId", SqlDbType = SqlDbType.BigInt, Value = base.StoreLock.SurrogateLockOwnerId });
System\Activities\DurableInstancing\ExtendLockAsyncResult.cs (2)
48sqlCommand.Parameters.Add(new SqlParameter { ParameterName = "@surrogateLockOwnerId", SqlDbType = SqlDbType.BigInt, Value = surrogateOwnerId }); 49sqlCommand.Parameters.Add(new SqlParameter { ParameterName = "@lockTimeout", SqlDbType = SqlDbType.Int, Value = lockTimeout });
System\Activities\DurableInstancing\LoadWorkflowAsyncResult.cs (11)
65parameters.Add(new SqlParameter { ParameterName = "@surrogateLockOwnerId", SqlDbType = SqlDbType.BigInt, Value = surrogateLockOwnerId }); 66parameters.Add(new SqlParameter { ParameterName = "@operationType", SqlDbType = SqlDbType.TinyInt, Value = loadType }); 67parameters.Add(new SqlParameter { ParameterName = "@keyToLoadBy", SqlDbType = SqlDbType.UniqueIdentifier, Value = keyToLoadBy }); 68parameters.Add(new SqlParameter { ParameterName = "@instanceId", SqlDbType = SqlDbType.UniqueIdentifier, Value = instanceId }); 69parameters.Add(new SqlParameter { ParameterName = "@handleInstanceVersion", SqlDbType = SqlDbType.BigInt, Value = base.InstancePersistenceContext.InstanceVersion }); 70parameters.Add(new SqlParameter { ParameterName = "@handleIsBoundToLock", SqlDbType = SqlDbType.Bit, Value = base.InstancePersistenceContext.InstanceView.IsBoundToLock }); 71parameters.Add(new SqlParameter { ParameterName = "@keysToAssociate", SqlDbType = SqlDbType.Xml, Value = singleKeyToAssociate ? DBNull.Value : SerializationUtilities.CreateCorrelationKeyXmlBlob(keysToAssociate) }); 72parameters.Add(new SqlParameter { ParameterName = "@encodingOption", SqlDbType = SqlDbType.TinyInt, Value = base.Store.InstanceEncodingOption }); 73parameters.Add(new SqlParameter { ParameterName = "@concatenatedKeyProperties", SqlDbType = SqlDbType.VarBinary, Value = (object) concatenatedKeyProperties ?? DBNull.Value }); 74parameters.Add(new SqlParameter { ParameterName = "@operationTimeout", SqlDbType = SqlDbType.Int, Value = (operationTimeout < Int32.MaxValue) ? Convert.ToInt32(operationTimeout) : Int32.MaxValue }); 75parameters.Add(new SqlParameter { ParameterName = "@singleKeyId", SqlDbType = SqlDbType.UniqueIdentifier, Value = singleKeyToAssociate ? keysToAssociate[0].KeyId : (object) DBNull.Value });
System\Activities\DurableInstancing\SaveWorkflowAsyncResult.cs (50)
74parameters.Add(new SqlParameter { ParameterName = "@instanceId", SqlDbType = SqlDbType.UniqueIdentifier, Value = base.InstancePersistenceContext.InstanceView.InstanceId }); 75parameters.Add(new SqlParameter { ParameterName = "@surrogateLockOwnerId", SqlDbType = SqlDbType.BigInt, Value = base.StoreLock.SurrogateLockOwnerId }); 76parameters.Add(new SqlParameter { ParameterName = "@handleInstanceVersion", SqlDbType = SqlDbType.BigInt, Value = base.InstancePersistenceContext.InstanceVersion }); 77parameters.Add(new SqlParameter { ParameterName = "@handleIsBoundToLock", SqlDbType = SqlDbType.Bit, Value = base.InstancePersistenceContext.InstanceView.IsBoundToLock }); 78parameters.Add(new SqlParameter { ParameterName = "@timerDurationMilliseconds", SqlDbType = SqlDbType.BigInt, Value = (object)GetPendingTimerExpiration(saveWorkflowCommand) ?? DBNull.Value }); 79parameters.Add(new SqlParameter { ParameterName = "@unlockInstance", SqlDbType = SqlDbType.Bit, Value = saveWorkflowCommand.UnlockInstance }); 80parameters.Add(new SqlParameter { ParameterName = "@suspensionStateChange", SqlDbType = SqlDbType.TinyInt, Value = GetSuspensionReason(saveWorkflowCommand, out suspensionReason, out suspensionExceptionName) }); 81parameters.Add(new SqlParameter { ParameterName = "@suspensionReason", SqlDbType = SqlDbType.NVarChar, Value = (object)suspensionReason ?? DBNull.Value }); 82parameters.Add(new SqlParameter { ParameterName = "@suspensionExceptionName", SqlDbType = SqlDbType.NVarChar, Size = 450, Value = (object)suspensionExceptionName ?? DBNull.Value }); 83parameters.Add(new SqlParameter { ParameterName = "@isCompleted", SqlDbType = SqlDbType.Bit, Value = saveWorkflowCommand.CompleteInstance }); 84parameters.Add(new SqlParameter { ParameterName = "@isReadyToRun", SqlDbType = SqlDbType.Bit, Value = IsReadyToRun(saveWorkflowCommand) }); 85parameters.Add(new SqlParameter { ParameterName = "@workflowHostType", SqlDbType = SqlDbType.UniqueIdentifier, Value = (object)GetWorkflowHostType(saveWorkflowCommand) ?? DBNull.Value }); 86parameters.Add(new SqlParameter { ParameterName = "@operationTimeout", SqlDbType = SqlDbType.Int, Value = (operationTimeout < Int32.MaxValue) ? Convert.ToInt32(operationTimeout) : Int32.MaxValue }); 92parameters.Add(new SqlParameter { ParameterName = "@identityMetadata", SqlDbType = SqlDbType.Xml, Value = (object)identityMetadataXml ?? DBNull.Value }); 194parameters.Add(new SqlParameter { ParameterName = parameterName, SqlDbType = SqlDbType.VarBinary, Size = parameterSize, Value = parameterValue }); 436parameters.Add(new SqlParameter { ParameterName = "@serviceDeploymentHash", SqlDbType = SqlDbType.UniqueIdentifier, Value = this.serviceDeploymentHash }); 437parameters.Add(new SqlParameter { ParameterName = "@serviceName", Size = -1, SqlDbType = SqlDbType.NVarChar, Value = serviceName ?? (object)DBNull.Value }); 438parameters.Add(new SqlParameter { ParameterName = "@serviceNamespace", Size = -1, SqlDbType = SqlDbType.NVarChar, Value = serviceNamespace ?? (object)DBNull.Value }); 439parameters.Add(new SqlParameter { ParameterName = "@siteName", Size = -1, SqlDbType = SqlDbType.NVarChar, Value = site ?? (object)DBNull.Value }); 440parameters.Add(new SqlParameter { ParameterName = "@relativeServicePath", Size = -1, SqlDbType = SqlDbType.NVarChar, Value = relativeServicePath ?? (object)DBNull.Value }); 441parameters.Add(new SqlParameter { ParameterName = "@relativeApplicationPath", Size = -1, SqlDbType = SqlDbType.NVarChar, Value = relativeApplicationPath ?? (object)DBNull.Value }); 445parameters.Add(new SqlParameter { ParameterName = "@serviceDeploymentId", SqlDbType = SqlDbType.BigInt, Value = (this.serviceDeploymentId != 0) ? (object)this.serviceDeploymentId : (object)DBNull.Value }); 479parameters.Add(new SqlParameter { ParameterName = "@keysToAssociate", SqlDbType = SqlDbType.Xml, Value = DBNull.Value }); 480parameters.Add(new SqlParameter { ParameterName = "@singleKeyId", SqlDbType = SqlDbType.UniqueIdentifier, Value = DBNull.Value }); 481parameters.Add(new SqlParameter { ParameterName = "@keysToComplete", SqlDbType = SqlDbType.Xml, Value = DBNull.Value }); 482parameters.Add(new SqlParameter { ParameterName = "@keysToFree", SqlDbType = SqlDbType.Xml, Value = DBNull.Value }); 483parameters.Add(new SqlParameter { ParameterName = "@concatenatedKeyProperties", SqlDbType = SqlDbType.VarBinary, Value = DBNull.Value }); 484parameters.Add(new SqlParameter { ParameterName = "@primitiveDataProperties", SqlDbType = SqlDbType.VarBinary, Value = DBNull.Value }); 485parameters.Add(new SqlParameter { ParameterName = "@complexDataProperties", SqlDbType = SqlDbType.VarBinary, Value = DBNull.Value }); 486parameters.Add(new SqlParameter { ParameterName = "@writeOnlyPrimitiveDataProperties", SqlDbType = SqlDbType.VarBinary, Value = DBNull.Value }); 487parameters.Add(new SqlParameter { ParameterName = "@writeOnlyComplexDataProperties", SqlDbType = SqlDbType.VarBinary, Value = DBNull.Value }); 488parameters.Add(new SqlParameter { ParameterName = "@metadataProperties", SqlDbType = SqlDbType.VarBinary, Value = DBNull.Value }); 489parameters.Add(new SqlParameter { ParameterName = "@metadataIsConsistent", SqlDbType = SqlDbType.Bit, Value = DBNull.Value }); 490parameters.Add(new SqlParameter { ParameterName = "@encodingOption", SqlDbType = SqlDbType.TinyInt, Value = DBNull.Value }); 491parameters.Add(new SqlParameter { ParameterName = "@lastMachineRunOn", SqlDbType = SqlDbType.NVarChar, Value = DBNull.Value }); 492parameters.Add(new SqlParameter { ParameterName = "@executionStatus", SqlDbType = SqlDbType.NVarChar, Value = DBNull.Value }); 493parameters.Add(new SqlParameter { ParameterName = "@blockingBookmarks", SqlDbType = SqlDbType.NVarChar, Value = DBNull.Value }); 507parameters.Add(new SqlParameter { ParameterName = "@keysToAssociate", SqlDbType = SqlDbType.Xml, Value = singleKeyToAssociate ? DBNull.Value : SerializationUtilities.CreateCorrelationKeyXmlBlob(keysToAssociate) }); 508parameters.Add(new SqlParameter { ParameterName = "@singleKeyId", SqlDbType = SqlDbType.UniqueIdentifier, Value = singleKeyToAssociate ? keysToAssociate[0].KeyId : (object)DBNull.Value }); 509parameters.Add(new SqlParameter { ParameterName = "@keysToComplete", SqlDbType = SqlDbType.Xml, Value = SerializationUtilities.CreateCorrelationKeyXmlBlob(keysToComplete) }); 510parameters.Add(new SqlParameter { ParameterName = "@keysToFree", SqlDbType = SqlDbType.Xml, Value = SerializationUtilities.CreateCorrelationKeyXmlBlob(keysToFree) }); 511parameters.Add(new SqlParameter { ParameterName = "@concatenatedKeyProperties", SqlDbType = SqlDbType.VarBinary, Size = -1, Value = (object)concatenatedKeyProperties ?? DBNull.Value }); 512parameters.Add(new SqlParameter { ParameterName = "@metadataIsConsistent", SqlDbType = SqlDbType.Bit, Value = metadataConsistency }); 513parameters.Add(new SqlParameter { ParameterName = "@encodingOption", SqlDbType = SqlDbType.TinyInt, Value = base.Store.InstanceEncodingOption }); 514parameters.Add(new SqlParameter { ParameterName = "@lastMachineRunOn", SqlDbType = SqlDbType.NVarChar, Size = 450, Value = SqlWorkflowInstanceStoreConstants.MachineName }); 515parameters.Add(new SqlParameter { ParameterName = "@executionStatus", SqlDbType = SqlDbType.NVarChar, Size = 450, Value = GetExecutionStatus(saveWorkflowCommand) ?? (object)DBNull.Value }); 516parameters.Add(new SqlParameter { ParameterName = "@blockingBookmarks", SqlDbType = SqlDbType.NVarChar, Size = -1, Value = GetBlockingBookmarks(saveWorkflowCommand) ?? (object)DBNull.Value }); 564parameters.Add(new SqlParameter() { SqlDbType = SqlDbType.Variant, ParameterName = argumentName, Value = propertyValue.Value ?? DBNull.Value }); 597parameters.Add(new SqlParameter() { SqlDbType = SqlDbType.NVarChar, Size = 400, ParameterName = promotionNameArgument, Value = promotion.Key }); 598parameters.Add(new SqlParameter() { SqlDbType = SqlDbType.UniqueIdentifier, ParameterName = instanceIdArgument, Value = base.InstancePersistenceContext.InstanceView.InstanceId });
System\Activities\DurableInstancing\TryLoadRunnableWorkflowAsyncResult.cs (7)
41command.Parameters.Add(new SqlParameter { ParameterName = "@surrogateLockOwnerId", SqlDbType = SqlDbType.BigInt, Value = base.StoreLock.SurrogateLockOwnerId }); 42command.Parameters.Add(new SqlParameter { ParameterName = "@workflowHostType", SqlDbType = SqlDbType.UniqueIdentifier, Value = base.Store.WorkflowHostType }); 43command.Parameters.Add(new SqlParameter { ParameterName = "@operationType", SqlDbType = SqlDbType.TinyInt, Value = LoadType.LoadByInstance }); 44command.Parameters.Add(new SqlParameter { ParameterName = "@handleInstanceVersion", SqlDbType = SqlDbType.BigInt, Value = base.InstancePersistenceContext.InstanceVersion }); 45command.Parameters.Add(new SqlParameter { ParameterName = "@handleIsBoundToLock", SqlDbType = SqlDbType.Bit, Value = base.InstancePersistenceContext.InstanceView.IsBoundToLock }); 46command.Parameters.Add(new SqlParameter { ParameterName = "@encodingOption", SqlDbType = SqlDbType.TinyInt, Value = base.Store.InstanceEncodingOption }); 47command.Parameters.Add(new SqlParameter { ParameterName = "@operationTimeout", SqlDbType = SqlDbType.Int, Value = (operationTimeout < Int32.MaxValue) ? Convert.ToInt32(operationTimeout) : Int32.MaxValue });
System\Activities\DurableInstancing\UnlockInstanceAsyncResult.cs (3)
36sqlCommand.Parameters.Add(new SqlParameter { ParameterName = "@instanceId", SqlDbType = SqlDbType.UniqueIdentifier, Value = unlockCommand.InstanceId }); 37sqlCommand.Parameters.Add(new SqlParameter { ParameterName = "@surrogateLockOwnerId", SqlDbType = SqlDbType.BigInt, Value = unlockCommand.SurrogateOwnerId }); 38sqlCommand.Parameters.Add(new SqlParameter { ParameterName = "@handleInstanceVersion", SqlDbType = SqlDbType.BigInt, Value = unlockCommand.InstanceVersion });
System.Data (1424)
fx\src\data\Microsoft\SqlServer\Server\ITypedGetters.cs (1)
22SqlDbType GetVariantType( int ordinal );
fx\src\data\Microsoft\SqlServer\Server\MetadataUtilsSmi.cs (156)
30internal const SqlDbType InvalidSqlDbType = (SqlDbType) (-1); 37static readonly SqlDbType[] __extendedTypeCodeToSqlDbTypeMap = { 39SqlDbType.Bit, // System.Boolean 40SqlDbType.TinyInt, // System.Byte 41SqlDbType.NVarChar, // System.Char 42SqlDbType.DateTime, // System.DateTime 44SqlDbType.Decimal, // System.Decimal 45SqlDbType.Float, // System.Double 47SqlDbType.SmallInt, // System.Int16 48SqlDbType.Int, // System.Int32 49SqlDbType.BigInt, // System.Int64 51SqlDbType.Real, // System.Single 52SqlDbType.NVarChar, // System.String 57SqlDbType.VarBinary, // System.ByteArray 58SqlDbType.NVarChar, // System.CharArray 59SqlDbType.UniqueIdentifier, // System.Guid 60SqlDbType.VarBinary, // System.Data.SqlTypes.SqlBinary 61SqlDbType.Bit, // System.Data.SqlTypes.SqlBoolean 62SqlDbType.TinyInt, // System.Data.SqlTypes.SqlByte 63SqlDbType.DateTime, // System.Data.SqlTypes.SqlDateTime 64SqlDbType.Float, // System.Data.SqlTypes.SqlDouble 65SqlDbType.UniqueIdentifier, // System.Data.SqlTypes.SqlGuid 66SqlDbType.SmallInt, // System.Data.SqlTypes.SqlInt16 67SqlDbType.Int, // System.Data.SqlTypes.SqlInt32 68SqlDbType.BigInt, // System.Data.SqlTypes.SqlInt64 69SqlDbType.Money, // System.Data.SqlTypes.SqlMoney 70SqlDbType.Decimal, // System.Data.SqlTypes.SqlDecimal 71SqlDbType.Real, // System.Data.SqlTypes.SqlSingle 72SqlDbType.NVarChar, // System.Data.SqlTypes.SqlString 73SqlDbType.NVarChar, // System.Data.SqlTypes.SqlChars 74SqlDbType.VarBinary, // System.Data.SqlTypes.SqlBytes 75SqlDbType.Xml, // System.Data.SqlTypes.SqlXml 76SqlDbType.Structured, // System.Data.DataTable 77SqlDbType.Structured, // System.Collections.IEnumerable, used for TVPs it must return IDataRecord 78SqlDbType.Structured, // System.Collections.Generic.IEnumerable<Microsoft.SqlServer.Server.SqlDataRecord> 79SqlDbType.Time, // System.TimeSpan 80SqlDbType.DateTimeOffset, // System.DateTimeOffset 139internal static bool IsCharOrXmlType(SqlDbType type) { 142type == SqlDbType.Xml; 145internal static bool IsUnicodeType(SqlDbType type) { 146return type == SqlDbType.NChar || 147type == SqlDbType.NVarChar || 148type == SqlDbType.NText; 151internal static bool IsAnsiType(SqlDbType type) { 152return type == SqlDbType.Char || 153type == SqlDbType.VarChar || 154type == SqlDbType.Text; 157internal static bool IsBinaryType(SqlDbType type) { 158return type == SqlDbType.Binary || 159type == SqlDbType.VarBinary || 160type == SqlDbType.Image; 166metaData.SqlDbType == SqlDbType.Image || 167metaData.SqlDbType == SqlDbType.NText || 168metaData.SqlDbType == SqlDbType.Text || 169metaData.SqlDbType == SqlDbType.Udt; 186SqlDbType dbType, 203case SqlDbType.BigInt: 211case SqlDbType.Binary: 212case SqlDbType.VarBinary: 213case SqlDbType.Image: 214case SqlDbType.Timestamp: 224case SqlDbType.Bit: 232case SqlDbType.Char: 233case SqlDbType.NChar: 234case SqlDbType.NText: 235case SqlDbType.NVarChar: 236case SqlDbType.Text: 237case SqlDbType.VarChar: 255case SqlDbType.Date: 256case SqlDbType.DateTime2: 258goto case SqlDbType.DateTime; 261case SqlDbType.DateTime: 262case SqlDbType.SmallDateTime: 270case SqlDbType.Decimal: 278case SqlDbType.Real: 286case SqlDbType.Int: 294case SqlDbType.Money: 295case SqlDbType.SmallMoney: 303case SqlDbType.Float: 311case SqlDbType.UniqueIdentifier: 317case SqlDbType.SmallInt: 325case SqlDbType.TinyInt: 333case SqlDbType.Variant: 343case SqlDbType.Udt: 354case SqlDbType.Time: 358case SqlDbType.DateTimeOffset: 362case SqlDbType.Xml: 370case SqlDbType.Structured: 436static internal SqlDbType InferSqlDbTypeFromTypeCode( ExtendedClrTypeCode typeCode ) { 444static internal SqlDbType InferSqlDbTypeFromType(Type type) { 446SqlDbType returnType; 462static internal SqlDbType InferSqlDbTypeFromType_Katmai(Type type) { 463SqlDbType returnType = InferSqlDbTypeFromType(type); 464if (SqlDbType.DateTime == returnType) { 465returnType = SqlDbType.DateTime2; 477return md.SqlDbType != SqlDbType.Structured && 478md.SqlDbType != SqlDbType.Date && 479md.SqlDbType != SqlDbType.DateTime2 && 480md.SqlDbType != SqlDbType.DateTimeOffset && 481md.SqlDbType != SqlDbType.Time; 486if (SqlDbType.Xml == source.SqlDbType) { 519if (SqlDbType.Xml == source.SqlDbType) { 524else if (SqlDbType.Udt == source.SqlDbType) { 580firstMd.SqlDbType != SqlDbType.Structured && // SqlMetaData doesn't support Structured types 584static internal long AdjustMaxLength(SqlDbType dbType, long maxLength) { 591case SqlDbType.Binary: 596case SqlDbType.Char: 601case SqlDbType.NChar: 606case SqlDbType.NVarChar: 612case SqlDbType.VarBinary: 618case SqlDbType.VarChar: 634SqlDbType dbType = InferSqlDbTypeFromType_Katmai(column.DataType); 678else if (dbType == SqlDbType.DateTime2 || dbType == SqlDbType.DateTimeOffset || dbType == SqlDbType.Time) { 683else if (dbType == SqlDbType.Decimal) { 751SqlDbType colDbType = InferSqlDbTypeFromType_Katmai(colType); 755colDbType = SqlDbType.VarBinary; 767case SqlDbType.BigInt: 768case SqlDbType.Bit: 769case SqlDbType.DateTime: 770case SqlDbType.Float: 771case SqlDbType.Image: 772case SqlDbType.Int: 773case SqlDbType.Money: 774case SqlDbType.NText: 775case SqlDbType.Real: 776case SqlDbType.UniqueIdentifier: 777case SqlDbType.SmallDateTime: 778case SqlDbType.SmallInt: 779case SqlDbType.SmallMoney: 780case SqlDbType.Text: 781case SqlDbType.Timestamp: 782case SqlDbType.TinyInt: 783case SqlDbType.Variant: 784case SqlDbType.Xml: 785case SqlDbType.Date: 788case SqlDbType.Binary: 789case SqlDbType.VarBinary: 794if (SqlDbType.Binary == colDbType) { 813SqlDbType.Binary == colDbType))) { 818case SqlDbType.Char: 819case SqlDbType.VarChar: 824if (SqlDbType.Char == colDbType) { 843SqlDbType.Char == colDbType))) { 848case SqlDbType.NChar: 849case SqlDbType.NVarChar: 854if (SqlDbType.NChar == colDbType) { 873SqlDbType.NChar == colDbType))) { 878case SqlDbType.Decimal: 904case SqlDbType.Time: 905case SqlDbType.DateTime2: 906case SqlDbType.DateTimeOffset: 923case SqlDbType.Udt: 924case SqlDbType.Structured:
fx\src\data\Microsoft\SqlServer\Server\SmiMetaData.cs (128)
52private SqlDbType _databaseType; // Main enum that determines what is valid for other attributes. 98internal static readonly SmiMetaData DefaultBigInt = new SmiMetaData(SqlDbType.BigInt, 8, 19, 0, SqlCompareOptions.None); // SqlDbType.BigInt 99internal static readonly SmiMetaData DefaultBinary = new SmiMetaData(SqlDbType.Binary, 1, 0, 0, SqlCompareOptions.None); // SqlDbType.Binary 100internal static readonly SmiMetaData DefaultBit = new SmiMetaData(SqlDbType.Bit, 1, 1, 0, SqlCompareOptions.None); // SqlDbType.Bit 101internal static readonly SmiMetaData DefaultChar_NoCollation = new SmiMetaData(SqlDbType.Char, 1, 0, 0, DefaultStringCompareOptions);// SqlDbType.Char 102internal static readonly SmiMetaData DefaultDateTime = new SmiMetaData(SqlDbType.DateTime, 8, 23, 3, SqlCompareOptions.None); // SqlDbType.DateTime 103internal static readonly SmiMetaData DefaultDecimal = new SmiMetaData(SqlDbType.Decimal, 9, 18, 0, SqlCompareOptions.None); // SqlDbType.Decimal 104internal static readonly SmiMetaData DefaultFloat = new SmiMetaData(SqlDbType.Float, 8, 53, 0, SqlCompareOptions.None); // SqlDbType.Float 105internal static readonly SmiMetaData DefaultImage = new SmiMetaData(SqlDbType.Image, UnlimitedMaxLengthIndicator,0, 0, SqlCompareOptions.None); // SqlDbType.Image 106internal static readonly SmiMetaData DefaultInt = new SmiMetaData(SqlDbType.Int, 4, 10, 0, SqlCompareOptions.None); // SqlDbType.Int 107internal static readonly SmiMetaData DefaultMoney = new SmiMetaData(SqlDbType.Money, 8, 19, 4, SqlCompareOptions.None); // SqlDbType.Money 108internal static readonly SmiMetaData DefaultNChar_NoCollation = new SmiMetaData(SqlDbType.NChar, 1, 0, 0, DefaultStringCompareOptions);// SqlDbType.NChar 109internal static readonly SmiMetaData DefaultNText_NoCollation = new SmiMetaData(SqlDbType.NText, UnlimitedMaxLengthIndicator,0, 0, DefaultStringCompareOptions);// SqlDbType.NText 110internal static readonly SmiMetaData DefaultNVarChar_NoCollation = new SmiMetaData(SqlDbType.NVarChar, MaxUnicodeCharacters, 0, 0, DefaultStringCompareOptions);// SqlDbType.NVarChar 111internal static readonly SmiMetaData DefaultReal = new SmiMetaData(SqlDbType.Real, 4, 24, 0, SqlCompareOptions.None); // SqlDbType.Real 112internal static readonly SmiMetaData DefaultUniqueIdentifier = new SmiMetaData(SqlDbType.UniqueIdentifier, 16, 0, 0, SqlCompareOptions.None); // SqlDbType.UniqueIdentifier 113internal static readonly SmiMetaData DefaultSmallDateTime = new SmiMetaData(SqlDbType.SmallDateTime, 4, 16, 0, SqlCompareOptions.None); // SqlDbType.SmallDateTime 114internal static readonly SmiMetaData DefaultSmallInt = new SmiMetaData(SqlDbType.SmallInt, 2, 5, 0, SqlCompareOptions.None); // SqlDbType.SmallInt 115internal static readonly SmiMetaData DefaultSmallMoney = new SmiMetaData(SqlDbType.SmallMoney, 4, 10, 4, SqlCompareOptions.None); // SqlDbType.SmallMoney 116internal static readonly SmiMetaData DefaultText_NoCollation = new SmiMetaData(SqlDbType.Text, UnlimitedMaxLengthIndicator,0, 0, DefaultStringCompareOptions);// SqlDbType.Text 117internal static readonly SmiMetaData DefaultTimestamp = new SmiMetaData(SqlDbType.Timestamp, 8, 0, 0, SqlCompareOptions.None); // SqlDbType.Timestamp 118internal static readonly SmiMetaData DefaultTinyInt = new SmiMetaData(SqlDbType.TinyInt, 1, 3, 0, SqlCompareOptions.None); // SqlDbType.TinyInt 119internal static readonly SmiMetaData DefaultVarBinary = new SmiMetaData(SqlDbType.VarBinary, MaxBinaryLength, 0, 0, SqlCompareOptions.None); // SqlDbType.VarBinary 120internal static readonly SmiMetaData DefaultVarChar_NoCollation = new SmiMetaData(SqlDbType.VarChar, MaxANSICharacters, 0, 0, DefaultStringCompareOptions);// SqlDbType.VarChar 121internal static readonly SmiMetaData DefaultVariant = new SmiMetaData(SqlDbType.Variant, 8016, 0, 0, SqlCompareOptions.None); // SqlDbType.Variant 122internal static readonly SmiMetaData DefaultXml = new SmiMetaData(SqlDbType.Xml, UnlimitedMaxLengthIndicator,0, 0, DefaultStringCompareOptions);// SqlDbType.Xml 123internal static readonly SmiMetaData DefaultUdt_NoType = new SmiMetaData(SqlDbType.Udt, 0, 0, 0, SqlCompareOptions.None); // SqlDbType.Udt 124internal static readonly SmiMetaData DefaultStructured = new SmiMetaData(SqlDbType.Structured, 0, 0, 0, SqlCompareOptions.None); // SqlDbType.Structured 125internal static readonly SmiMetaData DefaultDate = new SmiMetaData(SqlDbType.Date, 3, 10, 0, SqlCompareOptions.None); // SqlDbType.Date 126internal static readonly SmiMetaData DefaultTime = new SmiMetaData(SqlDbType.Time, 5, 0, 7, SqlCompareOptions.None); // SqlDbType.Time 127internal static readonly SmiMetaData DefaultDateTime2 = new SmiMetaData(SqlDbType.DateTime2, 8, 0, 7, SqlCompareOptions.None); // SqlDbType.DateTime2 128internal static readonly SmiMetaData DefaultDateTimeOffset = new SmiMetaData(SqlDbType.DateTimeOffset, 10, 0, 7, SqlCompareOptions.None); // SqlDbType.DateTimeOffset 255SqlDbType dbType, 277SqlDbType dbType, 298SqlDbType dbType, 324SqlDbType dbType, 345case SqlDbType.BigInt: 346case SqlDbType.Bit: 347case SqlDbType.DateTime: 348case SqlDbType.Float: 349case SqlDbType.Image: 350case SqlDbType.Int: 351case SqlDbType.Money: 352case SqlDbType.Real: 353case SqlDbType.SmallDateTime: 354case SqlDbType.SmallInt: 355case SqlDbType.SmallMoney: 356case SqlDbType.Timestamp: 357case SqlDbType.TinyInt: 358case SqlDbType.UniqueIdentifier: 359case SqlDbType.Variant: 360case SqlDbType.Xml: 361case SqlDbType.Date: 363case SqlDbType.Binary: 364case SqlDbType.VarBinary: 367case SqlDbType.Char: 368case SqlDbType.NChar: 369case SqlDbType.NVarChar: 370case SqlDbType.VarChar: 376case SqlDbType.NText: 377case SqlDbType.Text: 381case SqlDbType.Decimal: 389case SqlDbType.Udt: 404case SqlDbType.Structured: 411case SqlDbType.Time: 416case SqlDbType.DateTime2: 421case SqlDbType.DateTimeOffset: 450internal bool IsValidMaxLengthForCtorGivenType( SqlDbType dbType, long maxLength ) { 453case SqlDbType.BigInt: 454case SqlDbType.Bit: 455case SqlDbType.DateTime: 456case SqlDbType.Float: 457case SqlDbType.Image: 458case SqlDbType.Int: 459case SqlDbType.Money: 460case SqlDbType.Real: 461case SqlDbType.SmallDateTime: 462case SqlDbType.SmallInt: 463case SqlDbType.SmallMoney: 464case SqlDbType.Timestamp: 465case SqlDbType.TinyInt: 466case SqlDbType.UniqueIdentifier: 467case SqlDbType.Variant: 468case SqlDbType.Xml: 469case SqlDbType.NText: 470case SqlDbType.Text: 471case SqlDbType.Decimal: 472case SqlDbType.Udt: 473case SqlDbType.Structured: // 474case SqlDbType.Date: 475case SqlDbType.Time: 476case SqlDbType.DateTime2: 477case SqlDbType.DateTimeOffset: 479case SqlDbType.Binary: 482case SqlDbType.VarBinary: 485case SqlDbType.Char: 488case SqlDbType.NChar: 491case SqlDbType.NVarChar: 494case SqlDbType.VarChar: 540internal SqlDbType SqlDbType { 550if (null == _clrType && SqlDbType.Udt == _databaseType && _udtAssemblyQualifiedName != null) { 561if (null == _clrType && SqlDbType.Udt == _databaseType && _udtAssemblyQualifiedName != null) { 571if (SqlDbType.Udt == _databaseType) { 586if (SqlDbType.Udt == _databaseType) { 617internal static bool IsSupportedDbType(SqlDbType dbType) { 619return (SqlDbType.BigInt <= dbType && SqlDbType.Xml >= dbType) || 620(SqlDbType.Udt <= dbType && SqlDbType.DateTimeOffset >= dbType); 624internal static SmiMetaData GetDefaultForType( SqlDbType dbType ) { 633SqlDbType sqlDbType, 737private void SetDefaultsForType( SqlDbType dbType ) 815SqlDbType dbType, 844SqlDbType dbType, 874SqlDbType dbType, 907SqlDbType dbType, 994SqlDbType dbType, 1026SqlDbType dbType, 1058SqlDbType dbType, 1093SqlDbType dbType, 1171SqlDbType dbType, 1216SqlDbType dbType, 1261SqlDbType dbType, 1311SqlDbType dbType, 1453SqlDbType dbType, 1505internal SmiQueryMetaData( SqlDbType dbType, 1557internal SmiQueryMetaData( SqlDbType dbType, 1613internal SmiQueryMetaData( SqlDbType dbType,
fx\src\data\Microsoft\SqlServer\Server\SmiRecordBuffer.cs (1)
102public virtual SqlDbType GetVariantType( int ordinal ) {
fx\src\data\Microsoft\SqlServer\Server\SmiRequestExecutor.cs (1)
160public virtual SqlDbType GetVariantType( int ordinal ) {
fx\src\data\Microsoft\SqlServer\Server\SqlDataRecord.cs (4)
31static readonly SmiMetaData __maxNVarCharForXml = new SmiMetaData(SqlDbType.NVarChar, SmiMetaData.UnlimitedMaxLengthIndicator, 53if ( SqlDbType.Udt == metaData.SqlDbType ) { 63if (SqlDbType.Udt == GetSqlMetaData(ordinal).SqlDbType) { 196if (_usesStringStorageForXml && SqlDbType.Xml == colMeta.SqlDbType) {
fx\src\data\Microsoft\SqlServer\Server\SqlRecordBuffer.cs (8)
343|| _metadata.SqlDbType == SqlDbType.Money 344|| _metadata.SqlDbType == SqlDbType.NVarChar 345|| _metadata.SqlDbType == SqlDbType.DateTime 346|| _metadata.SqlDbType == SqlDbType.Date 347|| _metadata.SqlDbType == SqlDbType.DateTime2, 364case StorageType.SqlDecimal: return new SmiMetaData(SqlDbType.Decimal, 17, ((SqlDecimal)_object).Precision, ((SqlDecimal)_object).Scale, 0, SqlCompareOptions.None, null); 370Debug.Assert(value != null && (value.SqlDbType == SqlDbType.Money || value.SqlDbType == SqlDbType.NVarChar),
fx\src\data\Microsoft\SqlServer\Server\ValueUtilsSmi.cs (255)
114(SqlDbType.VarChar == metaData.SqlDbType || 115SqlDbType.NVarChar == metaData.SqlDbType || 116SqlDbType.Char == metaData.SqlDbType || 117SqlDbType.NChar == metaData.SqlDbType)) || 118SqlDbType.Xml == metaData.SqlDbType) { 406if (SqlDbType.Xml == metaData.SqlDbType) { 641else if (SqlDbType.Xml == metaData.SqlDbType) { 724if ((!isDbNull) && (metaData.SqlDbType == SqlDbType.Variant)) { 728if ((metaData.SqlDbType != SqlDbType.Variant) && (!CanAccessGetterDirectly(metaData, ExtendedClrTypeCode.Stream))) { 751if ((!isDbNull) && (metaData.SqlDbType == SqlDbType.Variant)) { 755if ((metaData.SqlDbType != SqlDbType.Variant) && (!CanAccessGetterDirectly(metaData, ExtendedClrTypeCode.TextReader))) { 808case SqlDbType.Variant: // Handle variants specifically for v200, since they could contain v200 types 811Debug.Assert(SqlDbType.Variant != metaData.SqlDbType, "Variant-within-variant causes endless recursion!"); 814case SqlDbType.Date: 815case SqlDbType.DateTime2: 818case SqlDbType.Time: 821case SqlDbType.DateTimeOffset: 847case SqlDbType.BigInt: 850case SqlDbType.Binary: 853case SqlDbType.Bit: 856case SqlDbType.Char: 859case SqlDbType.DateTime: 862case SqlDbType.Decimal: 865case SqlDbType.Float: 868case SqlDbType.Image: 871case SqlDbType.Int: 874case SqlDbType.Money: 877case SqlDbType.NChar: 880case SqlDbType.NText: 883case SqlDbType.NVarChar: 886case SqlDbType.Real: 889case SqlDbType.UniqueIdentifier: 892case SqlDbType.SmallDateTime: 895case SqlDbType.SmallInt: 898case SqlDbType.SmallMoney: 901case SqlDbType.Text: 904case SqlDbType.Timestamp: 907case SqlDbType.TinyInt: 910case SqlDbType.VarBinary: 913case SqlDbType.VarChar: 916case SqlDbType.Variant: 919Debug.Assert( SqlDbType.Variant != metaData.SqlDbType, "Variant-within-variant causes endless recursion!" ); 922case SqlDbType.Xml: 925case SqlDbType.Udt: 944if (SqlDbType.Udt == metaData.SqlDbType) { 951case SqlDbType.Variant: // Handle variants specifically for v200, since they could contain v200 types 954Debug.Assert(SqlDbType.Variant != metaData.SqlDbType, "Variant-within-variant causes endless recursion!"); 957case SqlDbType.Date: 958case SqlDbType.DateTime2: 961case SqlDbType.Time: 964case SqlDbType.DateTimeOffset: 986if (SqlDbType.Udt == metaData.SqlDbType) { 995case SqlDbType.BigInt: 998case SqlDbType.Binary: 1001case SqlDbType.Bit: 1004case SqlDbType.Char: 1007case SqlDbType.DateTime: 1010case SqlDbType.Decimal: 1013case SqlDbType.Float: 1016case SqlDbType.Image: 1019case SqlDbType.Int: 1022case SqlDbType.Money: 1025case SqlDbType.NChar: 1028case SqlDbType.NText: 1031case SqlDbType.NVarChar: 1034case SqlDbType.Real: 1037case SqlDbType.UniqueIdentifier: 1040case SqlDbType.SmallDateTime: 1043case SqlDbType.SmallInt: 1046case SqlDbType.SmallMoney: 1049case SqlDbType.Text: 1052case SqlDbType.Timestamp: 1055case SqlDbType.TinyInt: 1058case SqlDbType.VarBinary: 1061case SqlDbType.VarChar: 1064case SqlDbType.Variant: 1067Debug.Assert( SqlDbType.Variant != metaData.SqlDbType, "Variant-within-variant causes endless recursion!" ); 1070case SqlDbType.Xml: 1073case SqlDbType.Udt: 1127internal static SqlBuffer.StorageType SqlDbTypeToStorageType(SqlDbType dbType) { 1134if (SqlDbType.Udt == metaData.SqlDbType) { 1172case SqlDbType.BigInt: 1175case SqlDbType.Binary: 1176case SqlDbType.Image: 1177case SqlDbType.Timestamp: 1178case SqlDbType.VarBinary: 1181case SqlDbType.Bit: 1184case SqlDbType.NChar: 1185case SqlDbType.NText: 1186case SqlDbType.NVarChar: 1187case SqlDbType.Char: 1188case SqlDbType.VarChar: 1189case SqlDbType.Text: 1192case SqlDbType.DateTime: 1193case SqlDbType.SmallDateTime: { 1198case SqlDbType.Decimal: { 1203case SqlDbType.Float: 1206case SqlDbType.Int: 1209case SqlDbType.Money: 1210case SqlDbType.SmallMoney: 1213case SqlDbType.Real: 1216case SqlDbType.UniqueIdentifier: 1219case SqlDbType.SmallInt: 1222case SqlDbType.TinyInt: 1225case SqlDbType.Variant: 1229Debug.Assert( SqlDbType.Variant != metaData.SqlDbType, "Variant-within-variant not supposed to be possible!" ); 1232case SqlDbType.Udt: 1235 case SqlDbType.Xml: 1264case SqlDbType.Variant: // Handle variants specifically for v200, since they could contain v200 types 1268Debug.Assert( SqlDbType.Variant != metaData.SqlDbType, "Variant-within-variant not supposed to be possible!" ); 1271case SqlDbType.Date: 1274case SqlDbType.DateTime2: 1277case SqlDbType.Time: 1280case SqlDbType.DateTimeOffset: 1728case SqlDbType.BigInt: 1732case SqlDbType.Binary: 1736case SqlDbType.Bit: 1740case SqlDbType.Char: 1744case SqlDbType.DateTime: 1748case SqlDbType.Decimal: 1752case SqlDbType.Float: 1756case SqlDbType.Image: 1760case SqlDbType.Int: 1764case SqlDbType.Money: 1768case SqlDbType.NChar: 1769case SqlDbType.NText: 1770case SqlDbType.NVarChar: 1774case SqlDbType.Real: 1778case SqlDbType.UniqueIdentifier: 1782case SqlDbType.SmallDateTime: 1786case SqlDbType.SmallInt: 1790case SqlDbType.SmallMoney: 1794case SqlDbType.Text: 1798case SqlDbType.Timestamp: 1802case SqlDbType.TinyInt: 1806case SqlDbType.VarBinary: 1810case SqlDbType.VarChar: 1814case SqlDbType.Xml: 1818case SqlDbType.Variant: 1824case SqlDbType.Udt: 1854case SqlDbType.BigInt: 1858case SqlDbType.Binary: 1862case SqlDbType.Bit: 1866case SqlDbType.Char: 1870case SqlDbType.DateTime: 1874case SqlDbType.Decimal: { // block to scope sqlReader local to avoid conflicts 1886case SqlDbType.Float: 1890case SqlDbType.Image: 1894case SqlDbType.Int: 1898case SqlDbType.Money: 1902case SqlDbType.NChar: 1903case SqlDbType.NText: 1904case SqlDbType.NVarChar: 1908case SqlDbType.Real: 1912case SqlDbType.UniqueIdentifier: 1916case SqlDbType.SmallDateTime: 1920case SqlDbType.SmallInt: 1924case SqlDbType.SmallMoney: 1928case SqlDbType.Text: 1932case SqlDbType.Timestamp: 1936case SqlDbType.TinyInt: 1940case SqlDbType.VarBinary: 1944case SqlDbType.VarChar: 1948case SqlDbType.Xml: { 1959case SqlDbType.Variant: { // block to scope sqlReader local and avoid conflicts 1983case SqlDbType.Udt: 1991case SqlDbType.Date: 1992case SqlDbType.DateTime2: 1996case SqlDbType.Time: { // block to scope sqlReader local and avoid conflicts 2008case SqlDbType.DateTimeOffset: { // block to scope sqlReader local and avoid conflicts 2048case SqlDbType.BigInt: 2052case SqlDbType.Binary: 2056case SqlDbType.Bit: 2060case SqlDbType.Char: 2064case SqlDbType.DateTime: 2068case SqlDbType.Decimal: 2072case SqlDbType.Float: 2076case SqlDbType.Image: 2080case SqlDbType.Int: 2084case SqlDbType.Money: 2088case SqlDbType.NChar: 2089case SqlDbType.NText: 2090case SqlDbType.NVarChar: 2094case SqlDbType.Real: 2098case SqlDbType.UniqueIdentifier: 2102case SqlDbType.SmallDateTime: 2106case SqlDbType.SmallInt: 2110case SqlDbType.SmallMoney: 2114case SqlDbType.Text: 2118case SqlDbType.Timestamp: 2122case SqlDbType.TinyInt: 2126case SqlDbType.VarBinary: 2130case SqlDbType.VarChar: 2134case SqlDbType.Xml: 2138case SqlDbType.Variant: 2143case SqlDbType.Udt: 2171case SqlDbType.BigInt: 2175case SqlDbType.Binary: 2179case SqlDbType.Bit: 2183case SqlDbType.Char: 2187case SqlDbType.DateTime: 2191case SqlDbType.Decimal: 2195case SqlDbType.Float: 2199case SqlDbType.Image: 2203case SqlDbType.Int: 2207case SqlDbType.Money: 2211case SqlDbType.NChar: 2212case SqlDbType.NText: 2213case SqlDbType.NVarChar: 2217case SqlDbType.Real: 2221case SqlDbType.UniqueIdentifier: 2225case SqlDbType.SmallDateTime: 2229case SqlDbType.SmallInt: 2233case SqlDbType.SmallMoney: 2237case SqlDbType.Text: 2241case SqlDbType.Timestamp: 2245case SqlDbType.TinyInt: 2249case SqlDbType.VarBinary: 2253case SqlDbType.VarChar: 2257case SqlDbType.Xml: 2261case SqlDbType.Variant: 2266case SqlDbType.Udt: 2270case SqlDbType.Date: 2271case SqlDbType.DateTime2: 2275case SqlDbType.Time: 2291case SqlDbType.DateTimeOffset: 2394if (SqlDbType.Decimal == metaData.SqlDbType) { 2398Debug.Assert( SqlDbType.Money == metaData.SqlDbType || 2399SqlDbType.SmallMoney == metaData.SqlDbType, 2406if (SqlDbType.Decimal == metaData.SqlDbType || SqlDbType.Variant == metaData.SqlDbType) { 2410Debug.Assert( SqlDbType.Money == metaData.SqlDbType || 2411SqlDbType.SmallMoney == metaData.SqlDbType, 2420private static void VerifyDateTimeRange(SqlDbType dbType, DateTime value) { 2421if (SqlDbType.SmallDateTime == dbType && (x_dtSmallMax < value || x_dtSmallMin > value)) { 2428private static void VerifyTimeRange(SqlDbType dbType, TimeSpan value) { 2429if (SqlDbType.Time == dbType && (x_timeMin > value || value > x_timeMax)) { 2436SetDateTime_Unchecked(sink, setters, ordinal, ((SqlDbType.Date == metaData.SqlDbType) ? value.Date : value)); 2464if (!value.IsNull && SqlDbType.SmallMoney == metaData.SqlDbType) { 2746Debug.Assert( SqlDbType.BigInt == 0 && (int)SqlDbType.DateTimeOffset == __canAccessGetterDirectly.GetLength(1) - 1, "SqlDbType does not match with __canAccessGetterDirectly" ); 2748Debug.Assert( SqlDbType.BigInt <= metaData.SqlDbType && SqlDbType.DateTimeOffset >= metaData.SqlDbType ); 2766Debug.Assert( SqlDbType.BigInt == 0 && (int)SqlDbType.DateTimeOffset == __canAccessSetterDirectly.GetLength(1) - 1, "SqlDbType does not match with __canAccessSetterDirectly" ); 2768Debug.Assert( SqlDbType.BigInt <= metaData.SqlDbType && SqlDbType.DateTimeOffset >= metaData.SqlDbType ); 2797SqlDbType dbType, 2845if (SqlDbType.Variant == dbType) { 2857else if ( SqlDbType.Udt != dbType && 0 <= maxLength ) { 3323Debug.Assert(SqlDbType.Variant == metaData.SqlDbType, "Invalid type. This should be called only when the type is variant."); 3331Debug.Assert(SqlDbType.Variant == metaData.SqlDbType, "Invalid type. This should be called only when the type is variant."); 3553if ( SqlDbType.Variant == metaData.SqlDbType ) { 3579if (SqlDbType.Variant == metaData.SqlDbType) { 3582SqlDbType.NVarChar,
fx\src\data\System\Data\OleDb\OleDbParameter.cs (1)
38Debug.Assert(!(value is SqlDbType), "use OleDbParameter(string, OleDbType)");
fx\src\data\System\Data\Sql\SqlMetaData.cs (265)
31private SqlDbType m_sqlDbType; 61public SqlMetaData(String name, SqlDbType dbType) { 67public SqlMetaData(String name, SqlDbType dbType, bool useServerDefault, 75public SqlMetaData(String name, SqlDbType dbType, long maxLength) { 82public SqlMetaData(String name, SqlDbType dbType, long maxLength, bool useServerDefault, 89public SqlMetaData(String name, SqlDbType dbType, Type userDefinedType) { 95public SqlMetaData(String name, SqlDbType dbType, Type userDefinedType, string serverTypeName) { 101public SqlMetaData(String name, SqlDbType dbType, Type userDefinedType, string serverTypeName, 108public SqlMetaData(String name, SqlDbType dbType, byte precision, byte scale) { 114public SqlMetaData(string name, SqlDbType dbType, byte precision, byte scale, bool useServerDefault, 121public SqlMetaData(String name, SqlDbType dbType, long maxLength, long locale, 128public SqlMetaData(String name, SqlDbType dbType, long maxLength, long locale, 136public SqlMetaData(String name, SqlDbType dbType, string database, string owningSchema, 144public SqlMetaData(String name, SqlDbType dbType, long maxLength, byte precision, 153public SqlMetaData(String name, SqlDbType dbType, long maxLength, byte precision, 158case SqlDbType.BigInt: 159case SqlDbType.Image: 160case SqlDbType.Timestamp: 161case SqlDbType.Bit: 162case SqlDbType.DateTime: 163case SqlDbType.SmallDateTime: 164case SqlDbType.Real: 165case SqlDbType.Int: 166case SqlDbType.Money: 167case SqlDbType.SmallMoney: 168case SqlDbType.Float: 169case SqlDbType.UniqueIdentifier: 170case SqlDbType.SmallInt: 171case SqlDbType.TinyInt: 172case SqlDbType.Xml: 173case SqlDbType.Date: 176case SqlDbType.Binary: 177case SqlDbType.VarBinary: 180case SqlDbType.Char: 181case SqlDbType.NChar: 182case SqlDbType.NVarChar: 183case SqlDbType.VarChar: 186case SqlDbType.NText: 187case SqlDbType.Text: 191case SqlDbType.Decimal: 192case SqlDbType.Time: 193case SqlDbType.DateTime2: 194case SqlDbType.DateTimeOffset: 197case SqlDbType.Variant: 200case SqlDbType.Udt: 209public SqlMetaData(String name, SqlDbType dbType, string database, string owningSchema, string objectName) { 216SqlDbType sqlDBType, 247SqlDbType sqlDbType, 334public SqlDbType SqlDbType { 351else if (SqlDbType == SqlDbType.Udt) { 398if(SqlDbType != SqlDbType.Udt) { 411private void Construct(String name, SqlDbType dbType, bool useServerDefault, 418if (!( SqlDbType.BigInt == dbType || 419SqlDbType.Bit == dbType || 420SqlDbType.DateTime == dbType || 421SqlDbType.Date == dbType || 422SqlDbType.DateTime2 == dbType || 423SqlDbType.DateTimeOffset == dbType || 424SqlDbType.Decimal == dbType || 425SqlDbType.Float == dbType || 426SqlDbType.Image == dbType || 427SqlDbType.Int == dbType || 428SqlDbType.Money == dbType || 429SqlDbType.NText == dbType || 430SqlDbType.Real == dbType || 431SqlDbType.SmallDateTime == dbType || 432SqlDbType.SmallInt == dbType || 433SqlDbType.SmallMoney == dbType || 434SqlDbType.Text == dbType || 435SqlDbType.Time == dbType || 436SqlDbType.Timestamp == dbType || 437SqlDbType.TinyInt == dbType || 438SqlDbType.UniqueIdentifier == dbType || 439SqlDbType.Variant == dbType || 440SqlDbType.Xml == dbType) ) 445if (SqlDbType.NText == dbType || SqlDbType.Text == dbType) { 458private void Construct(String name, SqlDbType dbType, long maxLength, bool useServerDefault, 465if (SqlDbType.Char == dbType) { 470else if (SqlDbType.VarChar == dbType) { 475else if (SqlDbType.NChar == dbType) { 480else if (SqlDbType.NVarChar == dbType) { 485else if (SqlDbType.NText == dbType || SqlDbType.Text == dbType) { 491else if (SqlDbType.Binary == dbType) { 495else if (SqlDbType.VarBinary == dbType) { 499else if (SqlDbType.Image == dbType) { 520SqlDbType dbType, 533if (SqlDbType.Char == dbType) 538else if (SqlDbType.VarChar == dbType) 543else if (SqlDbType.NChar == dbType) 548else if (SqlDbType.NVarChar == dbType) 553else if (SqlDbType.NText == dbType || SqlDbType.Text == dbType) 594private void Construct( String name, SqlDbType dbType, byte precision, byte scale, bool useServerDefault, 600if (SqlDbType.Decimal == dbType) { 606} else if (SqlDbType.Time == dbType || SqlDbType.DateTime2 == dbType || SqlDbType.DateTimeOffset == dbType) { 618if (SqlDbType.Decimal == dbType) { 630private void Construct(String name, SqlDbType dbType, Type userDefinedType, string serverTypeName, bool useServerDefault, 636if (SqlDbType.Udt != dbType) 642SetDefaultsForType(SqlDbType.Udt); 655private void Construct(String name, SqlDbType dbType, string database, string owningSchema, 662if (SqlDbType.Xml != dbType) 671SetDefaultsForType(SqlDbType.Xml); 707if (SqlDbType.SmallInt != SqlDbType) 713if (SqlDbType.Int != SqlDbType) 719if (SqlDbType.BigInt != SqlDbType) 725if (SqlDbType.Real != SqlDbType) 731if (SqlDbType.Float != SqlDbType) 737if (SqlDbType.Char == SqlDbType || SqlDbType.NChar == SqlDbType) { 746else if (SqlDbType.VarChar != SqlDbType && 747SqlDbType.NVarChar != SqlDbType && 748SqlDbType.Text != SqlDbType && 749SqlDbType.NText != SqlDbType) { 765if (SqlDbType.Decimal != SqlDbType && 766SqlDbType.Money != SqlDbType && 767SqlDbType.SmallMoney != SqlDbType) { 771if (SqlDbType.Decimal != SqlDbType) { 782if (SqlDbType.DateTime == SqlDbType || SqlDbType.SmallDateTime == SqlDbType) { 784} else if (SqlDbType.DateTime2 == SqlDbType) { 786} else if (SqlDbType.Date == SqlDbType) { 795if (SqlDbType.UniqueIdentifier != SqlDbType) 801if (SqlDbType.Bit != SqlDbType) 807if (SqlDbType.TinyInt != SqlDbType) 813if (SqlDbType.SmallInt != SqlDbType) 819if (SqlDbType.Int != SqlDbType) 825if (SqlDbType.BigInt != SqlDbType) 831if (SqlDbType.Real != SqlDbType) 837if (SqlDbType.Float != SqlDbType) 843if (SqlDbType.Money != SqlDbType && 844SqlDbType.SmallMoney != SqlDbType) 854if (SqlDbType.DateTime != SqlDbType && 855SqlDbType.SmallDateTime != SqlDbType) 865if (SqlDbType.Decimal != SqlDbType) 871if (SqlDbType.Char == SqlDbType || SqlDbType.NChar == SqlDbType) 882else if (SqlDbType.VarChar != SqlDbType && SqlDbType.NVarChar != SqlDbType && 883SqlDbType.Text != SqlDbType && SqlDbType.NText != SqlDbType) 900if (SqlDbType.Binary == SqlDbType || 901SqlDbType.Timestamp == SqlDbType) { 913else if (SqlDbType.VarBinary != SqlDbType && 914SqlDbType.Image != SqlDbType) 934if (SqlDbType.UniqueIdentifier != SqlDbType) 940if (SqlDbType.Char == SqlDbType || SqlDbType.NChar == SqlDbType) { 964else if ( SqlDbType.VarChar != SqlDbType && SqlDbType.NVarChar != SqlDbType && 965SqlDbType.Text != SqlDbType && SqlDbType.NText != SqlDbType) 981if (SqlDbType.Binary == SqlDbType || SqlDbType.Timestamp == SqlDbType) { 1006else if (SqlDbType.VarBinary != SqlDbType && 1007SqlDbType.Image != SqlDbType) 1023if (SqlDbType.Xml != SqlDbType) 1029if (SqlDbType.Time != SqlDbType) 1036if (SqlDbType.DateTimeOffset != SqlDbType) 1132case TypeCode.Boolean: smd = new SqlMetaData(name, SqlDbType.Bit); break; 1133case TypeCode.Byte: smd = new SqlMetaData(name, SqlDbType.TinyInt); break; 1134case TypeCode.Char: smd = new SqlMetaData(name, SqlDbType.NVarChar, 1 ); break; 1135case TypeCode.DateTime: smd = new SqlMetaData(name, SqlDbType.DateTime); break; 1141smd = new SqlMetaData(name, SqlDbType.Decimal, sd.Precision, sd.Scale); 1144case TypeCode.Double: smd = new SqlMetaData(name, SqlDbType.Float); break; 1146case TypeCode.Int16: smd = new SqlMetaData(name, SqlDbType.SmallInt); break; 1147case TypeCode.Int32: smd = new SqlMetaData(name, SqlDbType.Int); break; 1148case TypeCode.Int64: smd = new SqlMetaData(name, SqlDbType.BigInt); break; 1150case TypeCode.Single: smd = new SqlMetaData(name, SqlDbType.Real); break; 1159smd = new SqlMetaData(name, SqlDbType.NVarChar, maxLen); 1174smd = new SqlMetaData(name, SqlDbType.VarBinary, maxLen); 1184smd = new SqlMetaData(name, SqlDbType.NVarChar, maxLen); 1187smd = new SqlMetaData(name, SqlDbType.UniqueIdentifier); 1189smd = new SqlMetaData(name, SqlDbType.Variant); 1203maxLen = sxm_rgDefaults[(int)SqlDbType.VarBinary].MaxLength; 1205smd = new SqlMetaData(name, SqlDbType.VarBinary, maxLen); 1208smd = new SqlMetaData(name, SqlDbType.Bit); 1210smd = new SqlMetaData(name, SqlDbType.TinyInt); 1212smd = new SqlMetaData(name, SqlDbType.DateTime); 1214smd = new SqlMetaData(name, SqlDbType.Float); 1216smd = new SqlMetaData(name, SqlDbType.UniqueIdentifier); 1218smd = new SqlMetaData(name, SqlDbType.SmallInt); 1220smd = new SqlMetaData(name, SqlDbType.Int); 1222smd = new SqlMetaData(name, SqlDbType.BigInt); 1224smd = new SqlMetaData(name, SqlDbType.Money); 1237bPrec = sxm_rgDefaults[(int)SqlDbType.Decimal].Precision; 1238scale = sxm_rgDefaults[(int)SqlDbType.Decimal].Scale; 1240smd = new SqlMetaData(name, SqlDbType.Decimal, bPrec, scale); 1243smd = new SqlMetaData(name, SqlDbType.Real); 1255smd = new SqlMetaData(name, SqlDbType.NVarChar, maxLen, ss.LCID, ss.SqlCompareOptions); 1259smd = new SqlMetaData(name, SqlDbType.NVarChar, sxm_rgDefaults[(int)SqlDbType.NVarChar].MaxLength); 1275maxLen = sxm_rgDefaults[(int)SqlDbType.NVarChar].MaxLength; 1277smd = new SqlMetaData(name, SqlDbType.NVarChar, maxLen); 1290maxLen = sxm_rgDefaults[(int)SqlDbType.VarBinary].MaxLength; 1292smd = new SqlMetaData(name, SqlDbType.VarBinary, maxLen); 1295smd = new SqlMetaData(name, SqlDbType.Xml); 1297smd = new SqlMetaData(name, SqlDbType.Time, 0, InferScaleFromTimeTicks(((TimeSpan)value).Ticks)); 1299smd = new SqlMetaData(name, SqlDbType.DateTimeOffset, 0, InferScaleFromTimeTicks(((DateTimeOffset)value).Ticks)); 1312if (SqlDbType.Bit != SqlDbType) 1318if (SqlDbType.TinyInt != SqlDbType) 1324if (SqlDbType.Binary == SqlDbType || SqlDbType.Timestamp == SqlDbType) 1340else if (SqlDbType.VarBinary != SqlDbType && 1341SqlDbType.Image != SqlDbType) 1363if (SqlDbType.Char == SqlDbType || SqlDbType.NChar == SqlDbType) 1369(SqlDbType.VarChar != SqlDbType && SqlDbType.NVarChar != SqlDbType && 1370SqlDbType.Text != SqlDbType && SqlDbType.NText != SqlDbType) 1379if (SqlDbType.Char == SqlDbType || SqlDbType.NChar == SqlDbType) 1400else if ( SqlDbType.VarChar != SqlDbType && SqlDbType.NVarChar != SqlDbType && 1401SqlDbType.Text != SqlDbType && SqlDbType.NText != SqlDbType) 1427if (md.SqlDbType == SqlDbType.Xml) 1430if (md.SqlDbType == SqlDbType.NVarChar || md.SqlDbType == SqlDbType.VarChar || 1431md.SqlDbType == SqlDbType.VarBinary) { 1450if (SqlDbType.SmallDateTime == SqlDbType && (x_dtSmallMax < value || x_dtSmallMin > value)) 1458if (SqlDbType.SmallMoney == SqlDbType && ((x_smSmallMax < value).Value || (x_smSmallMin > value).Value)) 1480if (SqlDbType.Time == SqlDbType && (x_timeMin > value || value > x_timeMax)) { 1547private void SetDefaultsForType( SqlDbType dbType ) 1549if ( SqlDbType.BigInt <= dbType && SqlDbType.DateTimeOffset >= dbType ) 1565new SqlMetaData("bigint", SqlDbType.BigInt, 1567new SqlMetaData("binary", SqlDbType.Binary, 1569new SqlMetaData("bit", SqlDbType.Bit, 1571new SqlMetaData("char", SqlDbType.Char, 1573new SqlMetaData("datetime", SqlDbType.DateTime, 1575new SqlMetaData("decimal", SqlDbType.Decimal, 1577new SqlMetaData("float", SqlDbType.Float, 1579new SqlMetaData("image", SqlDbType.Image, 1581new SqlMetaData("int", SqlDbType.Int, 1583new SqlMetaData("money", SqlDbType.Money, 1585new SqlMetaData("nchar", SqlDbType.NChar, 1587new SqlMetaData("ntext", SqlDbType.NText, 1589new SqlMetaData("nvarchar", SqlDbType.NVarChar, 1591new SqlMetaData("real", SqlDbType.Real, 1593new SqlMetaData("uniqueidentifier", SqlDbType.UniqueIdentifier, 1595new SqlMetaData("smalldatetime", SqlDbType.SmallDateTime, 1597new SqlMetaData("smallint", SqlDbType.SmallInt, 1599new SqlMetaData("smallmoney", SqlDbType.SmallMoney, 1601new SqlMetaData("text", SqlDbType.Text, 1603new SqlMetaData("timestamp", SqlDbType.Timestamp, 1605new SqlMetaData("tinyint", SqlDbType.TinyInt, 1607new SqlMetaData("varbinary", SqlDbType.VarBinary, 1609new SqlMetaData("varchar", SqlDbType.VarChar, 1611new SqlMetaData("sql_variant", SqlDbType.Variant, 1613new SqlMetaData("nvarchar", SqlDbType.NVarChar, 1615new SqlMetaData("xml", SqlDbType.Xml, 1617new SqlMetaData("nvarchar", SqlDbType.NVarChar, 1619new SqlMetaData("nvarchar", SqlDbType.NVarChar, 1621new SqlMetaData("nvarchar", SqlDbType.NVarChar, 1623new SqlMetaData("udt", SqlDbType.Udt, 1625new SqlMetaData("table", SqlDbType.Structured, 1627new SqlMetaData("date", SqlDbType.Date, 1629new SqlMetaData("time", SqlDbType.Time, 1631new SqlMetaData("datetime2", SqlDbType.DateTime2, 1633new SqlMetaData("datetimeoffset", SqlDbType.DateTimeOffset,
fx\src\data\System\Data\SqlClient\SqlBulkCopy.cs (23)
572if((metadata.type == SqlDbType.Timestamp) 599if(metadata.type == SqlDbType.Variant) { 602else if(metadata.type == SqlDbType.Udt) { 607AppendColumnNameAndTypeName(updateBulkCommandText, metadata.column, typeof(SqlDbType).GetEnumName(metadata.type)); 649else if(metadata.metaType.IsPlp && metadata.metaType.SqlDbType != SqlDbType.Xml) { 666case SqlDbType.Char: 667case SqlDbType.NChar: 668case SqlDbType.VarChar: 669case SqlDbType.NVarChar: 670case SqlDbType.Text: 671case SqlDbType.NText: 903if ((!isNull) && (metadata.type == SqlDbType.Udt)) { 1114if ((metadata.type == SqlDbType.VarBinary) && (mtSource.IsBinType) && (mtSource.SqlDbType != SqlDbType.Timestamp) && _SqlDataReaderRowSource.IsCommandBehavior(CommandBehavior.SequentialAccess)) { 1119else if (((metadata.type == SqlDbType.VarChar) || (metadata.type == SqlDbType.NVarChar)) && (mtSource.IsCharType) && (mtSource.SqlDbType != SqlDbType.Xml)) { 1123else if ((metadata.type == SqlDbType.Xml) && (mtSource.SqlDbType == SqlDbType.Xml)) { 1133if (metadata.type == SqlDbType.VarBinary) { 1137else if ((metadata.type == SqlDbType.VarChar) || (metadata.type == SqlDbType.NVarChar)) { 1978if (metadata.type != SqlDbType.Variant) {
fx\src\data\System\Data\SqlClient\SqlCommand.cs (67)
1927bool isXmlCapable = (null != md && md.Length == 1 && (md[0].SqlDbType == SqlDbType.NText 1928|| md[0].SqlDbType == SqlDbType.NVarChar 1929|| md[0].SqlDbType == SqlDbType.Xml)); 1933SqlStream sqlBuf = new SqlStream(ds, true /*addByteOrderMark*/, (md[0].SqlDbType == SqlDbType.Xml) ? false : true /*process all rows*/); 2796paramsCmd.Parameters.Add(new SqlParameter("@procedure_name", SqlDbType.NVarChar, 255)); 2800SqlParameter param = paramsCmd.Parameters.Add(new SqlParameter("@group_number", SqlDbType.Int)); 2805SqlParameter param = paramsCmd.Parameters.Add(new SqlParameter("@procedure_schema", SqlDbType.NVarChar, 255)); 2829p.SqlDbType = (SqlDbType)(short)r[colNames[(int)ProcParamsColIndex.ManagedDataType]]; 2834case SqlDbType.Image: 2835case SqlDbType.Timestamp: 2836p.SqlDbType = SqlDbType.VarBinary; 2839case SqlDbType.NText: 2840p.SqlDbType = SqlDbType.NVarChar; 2843case SqlDbType.Text: 2844p.SqlDbType = SqlDbType.VarChar; 2867(p.SqlDbType == SqlDbType.NVarChar || 2868p.SqlDbType == SqlDbType.VarBinary || 2869p.SqlDbType == SqlDbType.VarChar)) { 2878if (p.SqlDbType == SqlDbType.Decimal) { 2884if (SqlDbType.Udt == p.SqlDbType) { 2903if (SqlDbType.Structured == p.SqlDbType) { 2914if (SqlDbType.Xml == p.SqlDbType) { 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); 3795var attestationParametersParam = new SqlParameter(null, SqlDbType.VarBinary) { 5215if (SqlDbType.Udt == thisParam.SqlDbType) { 5250if (rec.type == SqlDbType.Decimal) { 5257else if (rec.type == SqlDbType.Xml) { 5453if (null == parameter.Value && (!inSchema || SqlDbType.Structured == parameter.SqlDbType)) { 5484sqlParam = new SqlParameter(null, SqlDbType.Int); 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); 5576sqlParam = new SqlParameter(null, SqlDbType.Int); 5604sqlParam = new SqlParameter(null, SqlDbType.Int); 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); 5769if (mt.SqlDbType == SqlDbType.Udt) { 5776else if (mt.SqlDbType == SqlDbType.Structured) { 5798if (mt.SqlDbType == SqlDbType.Decimal) { 5824else if (false == mt.IsFixed && false == mt.IsLong && mt.SqlDbType != SqlDbType.Timestamp && mt.SqlDbType != SqlDbType.Udt && SqlDbType.Structured != mt.SqlDbType) { 5861else if (mt.IsPlp && (mt.SqlDbType != SqlDbType.Xml) && (mt.SqlDbType != SqlDbType.Udt)) { 5961sqlParam = new SqlParameter(null, SqlDbType.Int); 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); 6252if (value is XmlDataFeed && requestMetaData[index].SqlDbType != SqlDbType.Xml) { 6270case SqlDbType.Image: 6271case SqlDbType.Text: 6277case SqlDbType.NText: 6283case SqlDbType.VarBinary: 6284case SqlDbType.VarChar: 6291case SqlDbType.NVarChar: 6298case SqlDbType.Timestamp: 6305case SqlDbType.Variant: 6321case SqlDbType.Xml:
fx\src\data\System\Data\SqlClient\SqlCommandBuilder.cs (2)
163p.SqlDbType = (SqlDbType) valueType; 166if ((p.SqlDbType == SqlDbType.Udt) && !p.SourceColumnNullMapping) {
fx\src\data\System\Data\SqlClient\SqlConnection.cs (6)
1992SqlParameter p = new SqlParameter(null, SqlDbType.VarChar, TdsEnums.SQLDEBUG_MODE_NAMES[option].Length); 1998p = new SqlParameter(null, SqlDbType.VarChar, sdiDllName.Length); 2002p = new SqlParameter(null, SqlDbType.VarChar, machineName.Length); 2009p = new SqlParameter(null, SqlDbType.Int); 2013p = new SqlParameter(null, SqlDbType.Int); 2020p = new SqlParameter(null, SqlDbType.VarBinary, (null != data) ? data.Length : 0);
fx\src\data\System\Data\SqlClient\SqlDataReader.cs (36)
294if (SqlDbType.Xml == colMetaData.type) { 299else if (SqlDbType.Udt == colMetaData.type) { 311else if (SqlDbType.NChar == colMetaData.type 312||SqlDbType.NVarChar == colMetaData.type) { 533schemaRow[ProviderType] = SqlDbType.NVarChar; 535case SqlDbType.Date: 538case SqlDbType.Time: 542case SqlDbType.DateTime2: 546case SqlDbType.DateTimeOffset: 554schemaRow[ProviderType] = SqlDbType.VarBinary; 558schemaRow[ProviderType] = SqlDbType.Image; 567if (col.type == SqlDbType.Udt) { // Additional metadata for UDTs. 571else if (col.type == SqlDbType.Xml) { // Additional metadata for Xml. 643if (SqlDbType.Timestamp == col.type) { 1192if (metaData.type == SqlDbType.Udt) { 1258if (metaData.type == SqlDbType.Udt) { 1346if (metaData.type == SqlDbType.Udt) { 1434if (mt.SqlDbType != SqlDbType.Xml) { 1470if (((!mt.IsBinType) || (mt.SqlDbType == SqlDbType.Timestamp)) && (mt.SqlDbType != SqlDbType.Variant)) { 1475if ((mt.SqlDbType != SqlDbType.Variant) && (IsCommandBehavior(CommandBehavior.SequentialAccess))) { 1512if (!(mt.IsLong || mt.IsBinType) || (SqlDbType.Xml == mt.SqlDbType)) { 1886if (((!mt.IsCharType) && (mt.SqlDbType != SqlDbType.Variant)) || (mt.SqlDbType == SqlDbType.Xml)) { 1891if ((mt.SqlDbType != SqlDbType.Variant) && (IsCommandBehavior(CommandBehavior.SequentialAccess))) { 1955SqlDbType sqlDbType; 1987if ( sqlDbType == SqlDbType.Xml ) { 2431Debug.Assert(!data.IsEmpty || data.IsNull || metaData.type == SqlDbType.Timestamp, "Data has been read, but the buffer is empty"); 2443if (metaData.type == SqlDbType.Udt) { 2460if (metaData.type == SqlDbType.Xml) { 2584Debug.Assert(!data.IsEmpty || data.IsNull || metaData.type == SqlDbType.Timestamp, "Data has been read, but the buffer is empty"); 2600if (metaData.type != SqlDbType.Udt) { 3455(_metaData[i].type == SqlDbType.Timestamp), // Or Dev11 Bug #336820, Dev10 Bug #479607 (SqlClient: IsDBNull always returns false for timestamp datatype) 3513if (isNull && columnMetaData.type != SqlDbType.Timestamp /* Maintain behavior for known bug (Dev10 479607) rejected as breaking change - See comments in GetNullSqlValue for timestamp */) 3589if ((metaType.IsLong) || (metaType.IsPlp) || (metaType.SqlDbType == SqlDbType.Udt) || (metaType.SqlDbType == SqlDbType.Structured)) {
fx\src\data\System\Data\SqlClient\SqlDataReaderSmi.cs (28)
66if ( SqlDbType.Udt == md.SqlDbType ) { 76if (SqlDbType.Udt == _currentMetaData[ordinal].SqlDbType) { 88if (SqlDbType.Udt == _currentMetaData[ordinal].SqlDbType) { 233if (metaData.SqlDbType == SqlDbType.Xml) { 567if (SqlDbType.Decimal == colMetaData.SqlDbType) { 571else if (SqlDbType.Variant == colMetaData.SqlDbType) { 583if (colMetaData.SqlDbType != SqlDbType.Udt) { 603case SqlDbType.BigInt: 604case SqlDbType.DateTime: 605case SqlDbType.Decimal: 606case SqlDbType.Int: 607case SqlDbType.Money: 608case SqlDbType.SmallDateTime: 609case SqlDbType.SmallInt: 610case SqlDbType.SmallMoney: 611case SqlDbType.TinyInt: 614case SqlDbType.Float: 617case SqlDbType.Real: 628if ( SqlDbType.Decimal == colMetaData.SqlDbType || 629SqlDbType.Time == colMetaData.SqlDbType || 630SqlDbType.DateTime2 == colMetaData.SqlDbType || 631SqlDbType.DateTimeOffset == colMetaData.SqlDbType) { 663if ( SqlDbType.Timestamp == colMetaData.SqlDbType ) { 696if ( SqlDbType.Udt == colMetaData.SqlDbType ) { 704if ( SqlDbType.Xml == colMetaData.SqlDbType ) { 860if ((metaData.SqlDbType != SqlDbType.Variant) && (IsCommandBehavior(CommandBehavior.SequentialAccess)) && (!ValueUtilsSmi.IsDBNull(_readerEventSink, _currentColumnValuesV3, ordinal))) { 878if ((metaData.SqlDbType != SqlDbType.Variant) && (IsCommandBehavior(CommandBehavior.SequentialAccess)) && (!ValueUtilsSmi.IsDBNull(_readerEventSink, _currentColumnValuesV3, ordinal))) { 894if (_currentMetaData[ordinal].SqlDbType != SqlDbType.Xml) {
fx\src\data\System\Data\SqlClient\SqlDependencyListener.cs (2)
152_conversationGuidParam = new SqlParameter("@p1", SqlDbType.UniqueIdentifier); 153_timeoutParam = new SqlParameter("@p2", SqlDbType.Int);
fx\src\data\System\Data\SqlClient\SqlEnums.cs (159)
40internal readonly SqlDbType SqlDbType; 61public MetaType(byte precision, byte scale, int fixedLength, bool isFixed, bool isLong, bool isPlp, byte tdsType, byte nullableTdsType, string typeName, Type classType, Type sqlType, SqlDbType sqldbType, DbType dbType, byte propBytes) { 98private static bool _IsAnsiType(SqlDbType type) { 99return(type == SqlDbType.Char || 100type == SqlDbType.VarChar || 101type == SqlDbType.Text); 105private static bool _IsSizeInCharacters(SqlDbType type) { 106return(type == SqlDbType.NChar || 107type == SqlDbType.NVarChar || 108type == SqlDbType.Xml || 109type == SqlDbType.NText); 112private static bool _IsCharType(SqlDbType type) { 113return(type == SqlDbType.NChar || 114type == SqlDbType.NVarChar || 115type == SqlDbType.NText || 116type == SqlDbType.Char || 117type == SqlDbType.VarChar || 118type == SqlDbType.Text || 119type == SqlDbType.Xml); 122private static bool _IsNCharType(SqlDbType type) { 123return(type == SqlDbType.NChar || 124type == SqlDbType.NVarChar || 125type == SqlDbType.NText || 126type == SqlDbType.Xml); 129private static bool _IsBinType(SqlDbType type) { 130return(type == SqlDbType.Image || 131type == SqlDbType.Binary || 132type == SqlDbType.VarBinary || 133type == SqlDbType.Timestamp || 134type == SqlDbType.Udt || 138private static bool _Is70Supported(SqlDbType type) { 139return((type != SqlDbType.BigInt) && ((int)type > 0) && 140((int)type <= (int) SqlDbType.VarChar)); 143private static bool _Is80Supported(SqlDbType type) { 145((int)type <= (int) SqlDbType.Variant)); 148private static bool _Is90Supported(SqlDbType type) { 150SqlDbType.Xml == type || 151SqlDbType.Udt == type; 154private static bool _Is100Supported(SqlDbType type) { 156SqlDbType.Date == type || 157SqlDbType.Time == type || 158SqlDbType.DateTime2 == type || 159SqlDbType.DateTimeOffset == type; 162private static bool _IsNewKatmaiType(SqlDbType type) { 163return SqlDbType.Structured == type; 166internal static bool _IsVarTime(SqlDbType type) { 167return (type == SqlDbType.Time || type == SqlDbType.DateTime2 || type == SqlDbType.DateTimeOffset); 173internal static MetaType GetMetaTypeFromSqlDbType(SqlDbType target, bool isMultiValued) { // WebData 113289 175case SqlDbType.BigInt: return MetaBigInt; 176case SqlDbType.Binary: return MetaBinary; 177case SqlDbType.Bit: return MetaBit; 178case SqlDbType.Char: return MetaChar; 179case SqlDbType.DateTime: return MetaDateTime; 180case SqlDbType.Decimal: return MetaDecimal; 181case SqlDbType.Float: return MetaFloat; 182case SqlDbType.Image: return MetaImage; 183case SqlDbType.Int: return MetaInt; 184case SqlDbType.Money: return MetaMoney; 185case SqlDbType.NChar: return MetaNChar; 186case SqlDbType.NText: return MetaNText; 187case SqlDbType.NVarChar: return MetaNVarChar; 188case SqlDbType.Real: return MetaReal; 189case SqlDbType.UniqueIdentifier: return MetaUniqueId; 190case SqlDbType.SmallDateTime: return MetaSmallDateTime; 191case SqlDbType.SmallInt: return MetaSmallInt; 192case SqlDbType.SmallMoney: return MetaSmallMoney; 193case SqlDbType.Text: return MetaText; 194case SqlDbType.Timestamp: return MetaTimestamp; 195case SqlDbType.TinyInt: return MetaTinyInt; 196case SqlDbType.VarBinary: return MetaVarBinary; 197case SqlDbType.VarChar: return MetaVarChar; 198case SqlDbType.Variant: return MetaVariant; 199case (SqlDbType)TdsEnums.SmallVarBinary: return MetaSmallVarBinary; 200case SqlDbType.Xml: return MetaXml; 201case SqlDbType.Udt: return MetaUdt; 202case SqlDbType.Structured: 209case SqlDbType.Date: return MetaDate; 210case SqlDbType.Time: return MetaTime; 211case SqlDbType.DateTime2: return MetaDateTime2; 212case SqlDbType.DateTimeOffset: return MetaDateTimeOffset; 250default: throw ADP.DbTypeNotSupported(target, typeof(SqlDbType)); // no direct mapping, error out 257case SqlDbType.VarBinary: 258case SqlDbType.Binary: 260case SqlDbType.VarChar: 261case SqlDbType.Char: 263case SqlDbType.NVarChar: 264case SqlDbType.NChar: 266case SqlDbType.Udt: 535internal static SqlDbType GetSqlDbTypeFromOleDbType(short dbType, string typeName) { 536SqlDbType sqlType = SqlDbType.Variant; 539sqlType = SqlDbType.BigInt; 542sqlType = SqlDbType.Bit; 547sqlType = (typeName == MetaTypeName.CHAR) ? SqlDbType.Char : SqlDbType.VarChar; 550sqlType = (typeName == MetaTypeName.SMALLMONEY) ? SqlDbType.SmallMoney : SqlDbType.Money; 557sqlType = SqlDbType.SmallDateTime; 560sqlType = SqlDbType.DateTime2; 563sqlType = SqlDbType.DateTime; 569sqlType = SqlDbType.Decimal; 572sqlType = SqlDbType.Float; 575sqlType = SqlDbType.UniqueIdentifier; 578sqlType = SqlDbType.Int; 581sqlType = SqlDbType.Image; 584sqlType = SqlDbType.Text; 587sqlType = SqlDbType.NText; 590sqlType = SqlDbType.Real; 594sqlType = SqlDbType.SmallInt; 598sqlType = SqlDbType.TinyInt; 602sqlType = (typeName == MetaTypeName.BINARY) ? SqlDbType.Binary : SqlDbType.VarBinary; 605sqlType = SqlDbType.Variant; 612sqlType = (typeName == MetaTypeName.NCHAR) ? SqlDbType.NChar : SqlDbType.NVarChar; 615sqlType = SqlDbType.Date; 618sqlType = SqlDbType.Udt; 621sqlType = SqlDbType.Xml; 624sqlType = SqlDbType.Time; 627sqlType = SqlDbType.DateTimeOffset; 692throw SQL.InvalidSqlDbType((SqlDbType)tdsType); 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); 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\sqlinternaltransaction.cs (1)
338SqlParameter parameter = new SqlParameter("@out", SqlDbType.Int);
fx\src\data\System\Data\SqlClient\sqlmetadatafactory.cs (2)
109newRow[providerDbtype] = SqlDbType.Udt; 221newRow[providerDbtype] = SqlDbType.Structured;
fx\src\data\System\Data\SqlClient\SqlParameter.cs (91)
131SqlDbType dbType, int size, 148SqlDbType dbType, int size, 170public SqlParameter(string parameterName, SqlDbType dbType) : this() { 176Debug.Assert(!(value is SqlDbType), "use SqlParameter(string, SqlDbType)"); 182public SqlParameter(string parameterName, SqlDbType dbType, int size) : this() { 188public SqlParameter(string parameterName, SqlDbType dbType, int size, string sourceColumn) : this() { 386if ( SqlDbType.NChar == mt.SqlDbType || SqlDbType.NVarChar == mt.SqlDbType ) { 397if ( SqlDbType.Binary == mt.SqlDbType || SqlDbType.VarBinary == mt.SqlDbType ) { 400else if ( SqlDbType.Char == mt.SqlDbType || SqlDbType.VarChar == mt.SqlDbType ) { 403else if ( SqlDbType.NChar == mt.SqlDbType || SqlDbType.NVarChar == mt.SqlDbType ) { 407else if (( maxLen > MSS.SmiMetaData.MaxBinaryLength && ( SqlDbType.Binary == mt.SqlDbType || SqlDbType.VarBinary == mt.SqlDbType )) 408|| ( maxLen > MSS.SmiMetaData.MaxANSICharacters && ( SqlDbType.Char == mt.SqlDbType || SqlDbType.VarChar == mt.SqlDbType )) 409|| ( maxLen > MSS.SmiMetaData.MaxUnicodeCharacters&& ( SqlDbType.NChar == mt.SqlDbType || SqlDbType.NVarChar == mt.SqlDbType )) ) { 440if (SqlDbType.Xml == mt.SqlDbType) { 445else if (SqlDbType.Udt == mt.SqlDbType || (SqlDbType.Structured == mt.SqlDbType && !ADP.IsEmpty(this.TypeName))) { 449if (SqlDbType.Udt == mt.SqlDbType) { 483if ( SqlDbType.Decimal == mt.SqlDbType ) { 492if (SqlDbType.Structured == mt.SqlDbType) { 503SqlDbType.Structured == mt.SqlDbType, 571SqlDbType dbtype = GetMetaSqlDbTypeOnly(); 572if ((0 == precision) && (SqlDbType.Decimal == dbtype)) { 578SqlDbType sqlDbType = SqlDbType; 579if (sqlDbType == SqlDbType.Decimal && value > TdsEnums.MAX_NUMERIC_PRECISION) { 607SqlDbType dbtype = GetMetaSqlDbTypeOnly(); 608if ((0 == scale) && (SqlDbType.Decimal == dbtype)) { 633public SqlDbType SqlDbType { 646if ((SqlDbType)TdsEnums.SmallVarBinary == value) { 651_metaType = MetaType.GetMetaTypeFromSqlDbType(value, value == SqlDbType.Structured); 689SqlDbType sqlDbType = GetMetaTypeOnly().SqlDbType; 690if (sqlDbType == SqlDbType.Date || sqlDbType == SqlDbType.DateTime2) { 779if (_internalMetaType.SqlDbType == Data.SqlDbType.Udt) { 791SqlDbType actualType = mt.SqlDbType; 793if ((_actualSize == -1) || (actualType == Data.SqlDbType.Udt)) { 804if (actualType == SqlDbType.Variant) { 822case SqlDbType.NChar: 823case SqlDbType.NVarChar: 824case SqlDbType.NText: 825case SqlDbType.Xml: 835case SqlDbType.Char: 836case SqlDbType.VarChar: 837case SqlDbType.Text: 847case SqlDbType.Binary: 848case SqlDbType.VarBinary: 849case SqlDbType.Image: 850case SqlDbType.Timestamp: 857case SqlDbType.Udt: 864case SqlDbType.Structured: 867case SqlDbType.Time: 870case SqlDbType.DateTime2: 874case SqlDbType.DateTimeOffset: 908((currentType != destinationType.SqlType) || (SqlDbType.Xml == destinationType.SqlDbType))) { // Special case for Xml types (since we need to convert SqlXml into a string) 949else if ((typeof(string) == currentType) && (SqlDbType.Time == destinationType.SqlDbType)) { 952else if ((typeof(string) == currentType) && (SqlDbType.DateTimeOffset == destinationType.SqlDbType)) { 955else if ((typeof(DateTime) == currentType) && (SqlDbType.DateTimeOffset == destinationType.SqlDbType)) { 1349if ((null == _coercedValue) || (_internalMetaType.SqlDbType == Data.SqlDbType.Udt)) { // will also be set during parameter Validation 1403private SqlDbType GetMetaSqlDbTypeOnly() { 1447else if ( (!ShouldSerializePrecision() && !ShouldSerializeScale()) && (_metaType.SqlDbType == SqlDbType.Decimal) ) { 1487(SqlDbType != SqlDbType.Timestamp) && 1488(SqlDbType != SqlDbType.Udt) && 1491(SqlDbType != SqlDbType.Xml) && 1497if (metaType.SqlDbType != SqlDbType.Udt && Direction != ParameterDirection.Output) { 1502if (metaType.SqlDbType == SqlDbType.Udt) { 1511if (metaType.SqlDbType == SqlDbType.Structured) { 1537if ((SqlDbType.Udt != mt.SqlDbType) && (false == mt.IsFixed) && (false == mt.IsLong)) { // if type has 2 byte length 1578if (mt.SqlDbType == SqlDbType.Xml) { 1581if (mt.SqlDbType == SqlDbType.NVarChar 1582|| mt.SqlDbType == SqlDbType.VarChar 1583|| mt.SqlDbType == SqlDbType.VarBinary) { 1590case SqlDbType.Binary: 1591case SqlDbType.VarBinary: 1592mt = MetaType.GetMetaTypeFromSqlDbType (SqlDbType.Image, false); 1596case SqlDbType.Char: 1597case SqlDbType.VarChar: 1598mt = MetaType.GetMetaTypeFromSqlDbType (SqlDbType.Text, false); 1602case SqlDbType.NChar: 1603case SqlDbType.NVarChar: 1604mt = MetaType.GetMetaTypeFromSqlDbType (SqlDbType.NText, false); 1813ctorParams = new Type[] { typeof(string), typeof(SqlDbType) }; 1818ctorParams = new Type[] { typeof(string), typeof(SqlDbType), typeof(int) }; 1825ctorParams = new Type[] { typeof(string), typeof(SqlDbType), typeof(int), typeof(string) }; 1835typeof(string), typeof(SqlDbType), typeof(int), typeof(ParameterDirection), 1847typeof(string), typeof(SqlDbType), typeof(int), typeof(ParameterDirection),
fx\src\data\System\Data\SqlClient\SqlParameterCollection.cs (3)
81public SqlParameter Add(string parameterName, SqlDbType sqlDbType) { 85public SqlParameter Add(string parameterName, SqlDbType sqlDbType, int size) { 89public SqlParameter Add(string parameterName, SqlDbType sqlDbType, int size, string sourceColumn) {
fx\src\data\System\Data\SqlClient\SqlUtil.cs (5)
459static internal Exception InvalidSqlDbType(SqlDbType value) { 460return ADP.InvalidEnumerationValue(typeof(SqlDbType), (int) value); 666static internal Exception InvalidSqlDbTypeForConstructor(SqlDbType type) { 1639static internal Exception InvalidSqlDbTypeOneAllowedType( SqlDbType invalidType, string method, SqlDbType allowedType ) {
fx\src\data\System\Data\SqlClient\TdsEnums.cs (3)
46public const SqlDbType SmallVarBinary = (SqlDbType) (SqlDbType.Variant)+1;
fx\src\data\System\Data\SqlClient\TdsParser.cs (106)
3451if (rec.type == SqlDbType.Decimal) { 3472if (rec.type == SqlDbType.Xml) { 4223if (col.type == SqlDbType.Decimal) { 4243case SqlDbType.Time: 4246case SqlDbType.DateTime2: 4250case SqlDbType.DateTimeOffset: 4783SqlDbType type = md.type; 4785if (type == SqlDbType.VarBinary && // if its a varbinary 4792case SqlDbType.Real: 4796case SqlDbType.Float: 4800case SqlDbType.Udt: 4801case SqlDbType.Binary: 4802case SqlDbType.VarBinary: 4803case SqlDbType.Image: 4807case SqlDbType.UniqueIdentifier: 4811case SqlDbType.Bit: 4815case SqlDbType.TinyInt: 4819case SqlDbType.SmallInt: 4823case SqlDbType.Int: 4827case SqlDbType.BigInt: 4831case SqlDbType.Char: 4832case SqlDbType.VarChar: 4833case SqlDbType.NChar: 4834case SqlDbType.NVarChar: 4835case SqlDbType.Text: 4836case SqlDbType.NText: 4840case SqlDbType.Decimal: 4844case SqlDbType.DateTime: 4845case SqlDbType.SmallDateTime: 4849case SqlDbType.Money: 4850case SqlDbType.SmallMoney: 4854case SqlDbType.Variant: 4859case SqlDbType.Xml: 4863case SqlDbType.Date: 4867case SqlDbType.Time: 4871case SqlDbType.DateTime2: 4875case SqlDbType.DateTimeOffset: 4879case SqlDbType.Timestamp: 8207if (mt.SqlDbType == SqlDbType.Decimal) { 8370if (mt.SqlDbType == SqlDbType.Timestamp) { 8373else if (mt.SqlDbType == SqlDbType.Udt) { 8427if (mt.SqlDbType != SqlDbType.Xml) 8430else if ((!mt.IsVarTime) && (mt.SqlDbType != SqlDbType.Date)) { // Time, Date, DateTime2, DateTimeoffset do not have the size written out 8445if (mt.SqlDbType == SqlDbType.Decimal) { 8463if (_isYukon && (mt.SqlDbType == SqlDbType.Xml)) { 8780if (SqlDbType.Structured == metaData.SqlDbType && metaData.IsMultiValued) { 8852case SqlDbType.BigInt: 8856case SqlDbType.Binary: 8860case SqlDbType.Bit: 8864case SqlDbType.Char: 8870case SqlDbType.DateTime: 8874case SqlDbType.Decimal: 8880case SqlDbType.Float: 8884case SqlDbType.Image: 8888case SqlDbType.Int: 8892case SqlDbType.Money: 8896case SqlDbType.NChar: 8902case SqlDbType.NText: 8908case SqlDbType.NVarChar: 8919case SqlDbType.Real: 8923case SqlDbType.UniqueIdentifier: 8927case SqlDbType.SmallDateTime: 8931case SqlDbType.SmallInt: 8935case SqlDbType.SmallMoney: 8939case SqlDbType.Text: 8945case SqlDbType.Timestamp: 8949case SqlDbType.TinyInt: 8953case SqlDbType.VarBinary: 8957case SqlDbType.VarChar: 8963case SqlDbType.Variant: 8967case SqlDbType.Xml: 8981case SqlDbType.Udt: 8987case SqlDbType.Structured: 8995case SqlDbType.Date: 8998case SqlDbType.Time: 9002case SqlDbType.DateTime2: 9006case SqlDbType.DateTimeOffset: 9017Debug.Assert(SqlDbType.Structured == metaData.SqlDbType && metaData.IsMultiValued, 9053if (SqlDbType.Timestamp == md.SqlDbType) { 9223Debug.Assert(SqlDbType.Xml != mdPriv.type); 9224Debug.Assert(SqlDbType.Udt != mdPriv.type); 9229case SqlDbType.Decimal: 9234case SqlDbType.Date: 9237case SqlDbType.Time: 9238case SqlDbType.DateTime2: 9239case SqlDbType.DateTimeOffset: 9330case SqlDbType.Decimal: 9336case SqlDbType.Xml: 9340case SqlDbType.Udt: 9344case SqlDbType.Date: 9347case SqlDbType.Time: 9348case SqlDbType.DateTime2: 9349case SqlDbType.DateTimeOffset: 9580((metatype.SqlDbType == SqlDbType.VarBinary && value is StreamDataFeed) || 9581((metatype.SqlDbType == SqlDbType.VarChar || metatype.SqlDbType == SqlDbType.NVarChar) && value is TextDataFeed) || 9582(metatype.SqlDbType == SqlDbType.Xml && value is XmlDataFeed)), 9591case SqlDbType.Text: 9592case SqlDbType.NText: 9593case SqlDbType.Image: 9598case SqlDbType.VarChar: 9599case SqlDbType.NVarChar: 9600case SqlDbType.VarBinary: 9601case SqlDbType.Xml: 9602case SqlDbType.Udt: 9615else if (metatype.SqlDbType != SqlDbType.Udt || metatype.IsLong) {
fx\src\data\System\Data\SqlClient\TdsParserHelperClasses.cs (6)
526return SqlDbType.Date == type || SqlDbType.Time == type || SqlDbType.DateTime2 == type || SqlDbType.DateTimeOffset == type; 532return type == SqlDbType.Udt && length == Int32.MaxValue; 819internal SqlDbType type; // SqlDbType enum value
fx\src\data\System\Data\SqlClient\TdsRecordBufferSetter.cs (1)
42Debug.Assert(SqlDbType.Structured == md.SqlDbType, "Unsupported SqlDbType: " + md.SqlDbType);
fx\src\data\System\Data\SqlClient\TdsValueSetter.cs (63)
67case SqlDbType.BigInt: 68case SqlDbType.Bit: 69case SqlDbType.DateTime: 70case SqlDbType.Decimal: 71case SqlDbType.Float: 72case SqlDbType.Int: 73case SqlDbType.Money: 74case SqlDbType.Real: 75case SqlDbType.UniqueIdentifier: 76case SqlDbType.SmallDateTime: 77case SqlDbType.SmallInt: 78case SqlDbType.SmallMoney: 79case SqlDbType.TinyInt: 80case SqlDbType.Date: 81case SqlDbType.Time: 82case SqlDbType.DateTime2: 83case SqlDbType.DateTimeOffset: 86case SqlDbType.Binary: 87case SqlDbType.Char: 88case SqlDbType.Image: 89case SqlDbType.NChar: 90case SqlDbType.NText: 91case SqlDbType.NVarChar: 92case SqlDbType.Text: 93case SqlDbType.Timestamp: 94case SqlDbType.VarBinary: 95case SqlDbType.VarChar: 98case SqlDbType.Udt: 99case SqlDbType.Xml: 102case SqlDbType.Variant: 105case SqlDbType.Structured: 119if (SqlDbType.Variant == _metaData.SqlDbType) { 137if (SqlDbType.Variant == _metaData.SqlDbType) { 182if (SqlDbType.Variant == _metaData.SqlDbType) { 206if (SqlDbType.Variant == _metaData.SqlDbType) { 262if (SqlDbType.Variant == _metaData.SqlDbType) { 329else if (SqlDbType.Variant == _metaData.SqlDbType) { 330Debug.Assert(null != _variantType && SqlDbType.NVarChar == _variantType.SqlDbType, "Invalid variant type"); 380if (SqlDbType.Variant == _metaData.SqlDbType) { 393if (SqlDbType.Variant == _metaData.SqlDbType) { 406if (SqlDbType.Variant == _metaData.SqlDbType) { 412Debug.Assert(SqlDbType.Money == _variantType.SqlDbType, "Invalid variant type"); 422if (SqlDbType.SmallMoney == _metaData.SqlDbType) { 425else if (SqlDbType.Money == _metaData.SqlDbType) { 439if (SqlDbType.Variant == _metaData.SqlDbType) { 452if (SqlDbType.Variant == _metaData.SqlDbType) { 465if (SqlDbType.Variant == _metaData.SqlDbType) { 481if (SqlDbType.Variant == _metaData.SqlDbType) { 482if ((_variantType != null) && (_variantType.SqlDbType == SqlDbType.DateTime2)) 486else if ((_variantType != null) && (_variantType.SqlDbType == SqlDbType.Date)) 505if (SqlDbType.SmallDateTime == _metaData.SqlDbType) { 511} else if (SqlDbType.DateTime == _metaData.SqlDbType) { 517if (SqlDbType.DateTime2 == _metaData.SqlDbType) { 534if (SqlDbType.Variant == _metaData.SqlDbType) { 551if (SqlDbType.Variant == _metaData.SqlDbType) { 571if (SqlDbType.Variant == _metaData.SqlDbType) { 598(value.SqlDbType == SqlDbType.Money || 599value.SqlDbType == SqlDbType.NVarChar || 600value.SqlDbType == SqlDbType.Date || 601value.SqlDbType == SqlDbType.DateTime || 602value.SqlDbType == SqlDbType.DateTime2 || 603value.SqlDbType == SqlDbType.DateTimeOffset || 604value.SqlDbType == SqlDbType.SmallDateTime
System.Data.Entity (40)
System\Data\SqlClient\SqlProviderServices.cs (40)
341SqlDbType sqlDbType = GetSqlDbType(type, isOutParam, version, out size, out precision, out scale, out udtTypeName); 347if (sqlDbType == SqlDbType.Udt) 442private static SqlDbType GetSqlDbType(TypeUsage type, bool isOutParam, SqlVersion version, out int? size, out byte? precision, out byte? scale, out string udtName) { 459return SqlDbType.Bit; 462return SqlDbType.TinyInt; 468return SqlDbType.Time; 474return SqlDbType.DateTimeOffset; 480return SqlDbType.DateTime2; 483return SqlDbType.DateTime; 489return SqlDbType.Decimal; 492return SqlDbType.Float; 497return SqlDbType.Udt; 503return SqlDbType.Udt; 507return SqlDbType.UniqueIdentifier; 510return SqlDbType.SmallInt; 513return SqlDbType.Int; 516return SqlDbType.BigInt; 519return SqlDbType.SmallInt; 522return SqlDbType.Real; 530return SqlDbType.Variant; 560private static int GetNonMaxLength(SqlDbType type) 563if (type == SqlDbType.NChar || type == SqlDbType.NVarChar) 567else if(type == SqlDbType.Char || type == SqlDbType.VarChar || 568type == SqlDbType.Binary || type == SqlDbType.VarBinary) 575private static int GetDefaultStringMaxLength(SqlVersion version, SqlDbType type) 580if (type == SqlDbType.NChar || type == SqlDbType.NVarChar) 652private static SqlDbType GetStringDbType(TypeUsage type) { 656SqlDbType dbType; 658dbType = SqlDbType.Xml; 674dbType = (unicode ? SqlDbType.NChar : SqlDbType.Char); 677dbType = (unicode ? SqlDbType.NVarChar : SqlDbType.VarChar); 686private static SqlDbType GetBinaryDbType(TypeUsage type) { 696return fixedLength ? SqlDbType.Binary : SqlDbType.VarBinary;
System.Data.Linq (414)
parent\DbmlShared\Mapping.cs (17)
507internal static bool IsSupportedDiscriminatorType(SqlDbType type) { 509case SqlDbType.BigInt: 510case SqlDbType.Bit: 511case SqlDbType.Char: 512case SqlDbType.Int: 513case SqlDbType.NChar: 514case SqlDbType.NVarChar: 515case SqlDbType.SmallInt: 516case SqlDbType.TinyInt: 517case SqlDbType.VarChar: 566internal static bool IsSupportedIdentityType(SqlDbType type) 569case SqlDbType.NText: 570case SqlDbType.Image: 571case SqlDbType.Xml: 572case SqlDbType.Text: 573case SqlDbType.Variant: 574case SqlDbType.Udt:
SqlClient\Common\SqlFactory.cs (10)
267SqlDbType sqlDbType = ((SqlTypeSystem.SqlType)(exp.SqlType)).SqlDbType; 268return (sqlDbType == SqlDbType.DateTime || sqlDbType == SqlDbType.SmallDateTime); 272return (((SqlTypeSystem.SqlType)(exp.SqlType)).SqlDbType == SqlDbType.Date); 276return (((SqlTypeSystem.SqlType)(exp.SqlType)).SqlDbType == SqlDbType.Time); 280return (((SqlTypeSystem.SqlType)(exp.SqlType)).SqlDbType == SqlDbType.DateTimeOffset); 284SqlDbType sqlDbType = ((SqlTypeSystem.SqlType)(exp.SqlType)).SqlDbType; 285return (sqlDbType == SqlDbType.Time || sqlDbType == SqlDbType.DateTime2 || sqlDbType == SqlDbType.DateTimeOffset);
SqlClient\Query\SqlParameterizer.cs (4)
141SqlDbType leftSqlDbType = ((SqlTypeSystem.SqlType)(bo.Left.SqlType)).SqlDbType; 142SqlDbType rightSqlDbType = ((SqlTypeSystem.SqlType)(bo.Right.SqlType)).SqlDbType; 151if (isLeftColRef && leftSqlDbType == SqlDbType.Time && bo.Right.ClrType == typeof(DateTime)) 153else if (isRightColRef && rightSqlDbType == SqlDbType.Time && bo.Left.ClrType == typeof(DateTime))
SqlClient\SqlTypeSystemProvider.cs (383)
38private static ProviderType Create(SqlDbType type, int size) { 42private static ProviderType Create(SqlDbType type, int precision, int scale) { 43if (type != SqlDbType.Decimal && precision == 0 && scale == 0) { 46else if (type == SqlDbType.Decimal && precision == defaultDecimalPrecision && scale == defaultDecimalScale) { 53private static ProviderType Create(SqlDbType type) { 55case SqlDbType.BigInt: return theBigInt; 56case SqlDbType.Bit: return theBit; 57case SqlDbType.Char: return theChar; 58case SqlDbType.DateTime: return theDateTime; 59case SqlDbType.Date: return theDate; 60case SqlDbType.Time: return theTime; 61case SqlDbType.DateTime2: return theDateTime2; 62case SqlDbType.DateTimeOffset: return theDateTimeOffset; 63case SqlDbType.Decimal: return theDefaultDecimal; 64case SqlDbType.Float: return theFloat; 65case SqlDbType.Int: return theInt; 66case SqlDbType.Money: return theMoney; 67case SqlDbType.Real: return theReal; 68case SqlDbType.UniqueIdentifier: return theUniqueIdentifier; 69case SqlDbType.SmallDateTime: return theSmallDateTime; 70case SqlDbType.SmallInt: return theSmallInt; 71case SqlDbType.SmallMoney: return theSmallMoney; 72case SqlDbType.Timestamp: return theTimestamp; 73case SqlDbType.TinyInt: return theTinyInt; 74case SqlDbType.Xml: return theXml; 75case SqlDbType.Text: return theText; 76case SqlDbType.NText: return theNText; 77case SqlDbType.Image: return theImage; 84private static Type GetClosestRuntimeType(SqlDbType sqlDbType) { 86case SqlDbType.Int: 88case SqlDbType.BigInt: 90case SqlDbType.Bit: 92case SqlDbType.Date: 93case SqlDbType.SmallDateTime: 94case SqlDbType.DateTime: 95case SqlDbType.DateTime2: 97case SqlDbType.DateTimeOffset: 99case SqlDbType.Time: 101case SqlDbType.Float: 103case SqlDbType.Real: 105case SqlDbType.Binary: 106case SqlDbType.Image: 107case SqlDbType.Timestamp: 108case SqlDbType.VarBinary: 110case SqlDbType.Decimal: 111case SqlDbType.Money: 112case SqlDbType.SmallMoney: 114case SqlDbType.Char: 115case SqlDbType.NChar: 116case SqlDbType.NText: 117case SqlDbType.NVarChar: 118case SqlDbType.Xml: 119case SqlDbType.VarChar: 120case SqlDbType.Text: 122case SqlDbType.UniqueIdentifier: 124case SqlDbType.SmallInt: 126case SqlDbType.TinyInt: 128case SqlDbType.Udt: 130throw Error.UnexpectedTypeCode(SqlDbType.Udt); 131case SqlDbType.Variant: 144static private readonly SqlType theBigInt = new SqlType(SqlDbType.BigInt); 145static private readonly SqlType theBit = new SqlType(SqlDbType.Bit); 146static private readonly SqlType theChar = new SqlType(SqlDbType.Char); 147static private readonly SqlType theDateTime = new SqlType(SqlDbType.DateTime); 148static private readonly SqlType theDate = new SqlType(SqlDbType.Date); 149static private readonly SqlType theTime = new SqlType(SqlDbType.Time); 150static private readonly SqlType theDateTime2 = new SqlType(SqlDbType.DateTime2); 151static private readonly SqlType theDateTimeOffset = new SqlType(SqlDbType.DateTimeOffset); 154static private readonly SqlType theDefaultDecimal = new SqlType(SqlDbType.Decimal, defaultDecimalPrecision, defaultDecimalScale); 155static private readonly SqlType theFloat = new SqlType(SqlDbType.Float); 156static private readonly SqlType theInt = new SqlType(SqlDbType.Int); 157static private readonly SqlType theMoney = new SqlType(SqlDbType.Money, 19, 4); 158static private readonly SqlType theReal = new SqlType(SqlDbType.Real); 159static private readonly SqlType theUniqueIdentifier = new SqlType(SqlDbType.UniqueIdentifier); 160static private readonly SqlType theSmallDateTime = new SqlType(SqlDbType.SmallDateTime); 161static private readonly SqlType theSmallInt = new SqlType(SqlDbType.SmallInt); 162static private readonly SqlType theSmallMoney = new SqlType(SqlDbType.SmallMoney, 10, 4); 163static private readonly SqlType theTimestamp = new SqlType(SqlDbType.Timestamp); 164static private readonly SqlType theTinyInt = new SqlType(SqlDbType.TinyInt); 165static private readonly SqlType theXml = new SqlType(SqlDbType.Xml, LargeTypeSizeIndicator); 166static private readonly SqlType theText = new SqlType(SqlDbType.Text, LargeTypeSizeIndicator); 167static private readonly SqlType theNText = new SqlType(SqlDbType.NText, LargeTypeSizeIndicator); 168static private readonly SqlType theImage = new SqlType(SqlDbType.Image, LargeTypeSizeIndicator); 207protected SqlDbType sqlDbType; 215internal SqlType(SqlDbType type) { 219internal SqlType(SqlDbType type, int? size) { 224internal SqlType(SqlDbType type, int precision, int scale) { 244case SqlDbType.NChar: 245case SqlDbType.NText: 246case SqlDbType.NVarChar: 256case SqlDbType.NChar: 257return new SqlType(SqlDbType.Char, this.Size); 258case SqlDbType.NText: 259return new SqlType(SqlDbType.Text); 260case SqlDbType.NVarChar: 261return new SqlType(SqlDbType.VarChar, this.Size); 303case SqlDbType.BigInt: // -2^63 (-9,223,372,036,854,775,808) to 2^63-1 (9,223,372,036,854,775,807) 304case SqlDbType.Bit: // 0 or 1 305case SqlDbType.Int: // -2^31 (-2,147,483,648) to 2^31-1 (2,147,483,647) 306case SqlDbType.SmallInt: // -2^15 (-32,768) to 2^15-1 (32,767) 307case SqlDbType.TinyInt: // 0 to 255 308case SqlDbType.Money: // -922,337,203,685,477.5808 to 922,337,203,685,477.5807 309case SqlDbType.SmallMoney: // -214,748.3648 to 214,748.3647 310case SqlDbType.Float: // -1.79E+308 to -2.23E-308, 0 and 2.23E-308 to 1.79E+308 311case SqlDbType.Real: // -3.40E+38 to -1.18E-38, 0 and 1.18E-38 to 3.40E+38 351case SqlDbType.NText: 352case SqlDbType.Image: 353case SqlDbType.Xml: 354case SqlDbType.Text: 365case SqlDbType.NText: 366case SqlDbType.Image: 367case SqlDbType.Xml: 368case SqlDbType.Text: 384case SqlDbType.Char: 385case SqlDbType.NChar: 386case SqlDbType.NVarChar: 387case SqlDbType.VarChar: 388case SqlDbType.Text: 404case SqlDbType.NText: 405case SqlDbType.Image: 406case SqlDbType.Xml: 407case SqlDbType.Text: 409case SqlDbType.NVarChar: 410case SqlDbType.VarChar: 411case SqlDbType.VarBinary: 422case SqlDbType.Decimal: 423case SqlDbType.Float: 424case SqlDbType.Real: 425case SqlDbType.Money: // precision and scale are fixed at 19,4 426case SqlDbType.SmallMoney: // precision and scale are fixed at 10,4 427case SqlDbType.DateTime2: 428case SqlDbType.DateTimeOffset: 429case SqlDbType.Time: 458case SqlDbType.BigInt: 459case SqlDbType.Bit: 460case SqlDbType.Date: 461case SqlDbType.Time: 462case SqlDbType.DateTime: 463case SqlDbType.DateTime2: 464case SqlDbType.DateTimeOffset: 465case SqlDbType.Int: 466case SqlDbType.Money: 467case SqlDbType.SmallDateTime: 468case SqlDbType.SmallInt: 469case SqlDbType.SmallMoney: 470case SqlDbType.Timestamp: 471case SqlDbType.TinyInt: 472case SqlDbType.UniqueIdentifier: 473case SqlDbType.Xml: 474case SqlDbType.Image: 475case SqlDbType.NText: 476case SqlDbType.Text: 477case SqlDbType.Udt: 480case SqlDbType.Variant: 483case SqlDbType.Binary: 484case SqlDbType.Char: 485case SqlDbType.NChar: 493case SqlDbType.NVarChar: 494case SqlDbType.VarBinary: 495case SqlDbType.VarChar: 508case SqlDbType.Decimal: 509case SqlDbType.Float: 510case SqlDbType.Real: 549case SqlDbType.NText: 550case SqlDbType.Text: 551case SqlDbType.NVarChar: 552case SqlDbType.VarChar: 553case SqlDbType.Image: 554case SqlDbType.VarBinary: 555case SqlDbType.Xml: 563internal SqlDbType SqlDbType { 572case SqlDbType.Image: 573case SqlDbType.Text: 574case SqlDbType.NText: 575case SqlDbType.Xml: 588case SqlDbType.Image: 589case SqlDbType.Text: 590case SqlDbType.NText: 591case SqlDbType.Xml: 613case SqlDbType.Bit: 614case SqlDbType.TinyInt: 615case SqlDbType.SmallInt: 616case SqlDbType.Int: 617case SqlDbType.BigInt: 618case SqlDbType.Decimal: 619case SqlDbType.Float: 620case SqlDbType.Real: 621case SqlDbType.Money: 622case SqlDbType.SmallMoney: 635case SqlDbType.Char: 636case SqlDbType.NChar: 637case SqlDbType.NVarChar: 638case SqlDbType.VarChar: 651case SqlDbType.Char: 652case SqlDbType.NChar: 653case SqlDbType.NVarChar: 654case SqlDbType.VarChar: 657case SqlDbType.Text: 658case SqlDbType.NText: 703private static int GetTypeCoercionPrecedence(SqlDbType type) { 705case SqlDbType.Binary: return 0; 706case SqlDbType.VarBinary: return 1; 707case SqlDbType.VarChar: return 2; 708case SqlDbType.Char: return 3; 709case SqlDbType.NChar: return 4; 710case SqlDbType.NVarChar: return 5; 711case SqlDbType.UniqueIdentifier: return 6; 712case SqlDbType.Timestamp: return 7; 713case SqlDbType.Image: return 8; 714case SqlDbType.Text: return 9; 715case SqlDbType.NText: return 10; 716case SqlDbType.Bit: return 11; 717case SqlDbType.TinyInt: return 12; 718case SqlDbType.SmallInt: return 13; 719case SqlDbType.Int: return 14; 720case SqlDbType.BigInt: return 15; 721case SqlDbType.SmallMoney: return 16; 722case SqlDbType.Money: return 17; 723case SqlDbType.Decimal: return 18; 724case SqlDbType.Real: return 19; 725case SqlDbType.Float: return 20; 726case SqlDbType.Date: return 21; 727case SqlDbType.Time: return 22; 728case SqlDbType.SmallDateTime: return 23; 729case SqlDbType.DateTime: return 24; 730case SqlDbType.DateTime2: return 25; 731case SqlDbType.DateTimeOffset: return 26; 732case SqlDbType.Xml: return 27; 733case SqlDbType.Variant: return 28; 734case SqlDbType.Udt: return 29; 757case SqlDbType.Bit: 758case SqlDbType.TinyInt: 759case SqlDbType.SmallInt: 760case SqlDbType.Int: 761case SqlDbType.BigInt: 762case SqlDbType.Decimal: 763case SqlDbType.Float: 764case SqlDbType.Real: 765case SqlDbType.Money: 766case SqlDbType.SmallMoney: 768case SqlDbType.Char: 769case SqlDbType.NChar: 770case SqlDbType.VarChar: 771case SqlDbType.NVarChar: 773case SqlDbType.Text: 774case SqlDbType.NText: 776case SqlDbType.Binary: 777case SqlDbType.VarBinary: 778case SqlDbType.Timestamp: 780case SqlDbType.Image: 782case SqlDbType.Xml: 784case SqlDbType.Date: 785case SqlDbType.Time: 786case SqlDbType.DateTime: 787case SqlDbType.DateTime2: 788case SqlDbType.DateTimeOffset: 789case SqlDbType.SmallDateTime: 791case SqlDbType.UniqueIdentifier: 793case SqlDbType.Variant: 795case SqlDbType.Udt: 877if (!Enum.GetNames(typeof(SqlDbType)).Select(n => n.ToUpperInvariant()).Contains(typeName.ToUpperInvariant())) 884SqlDbType dbType = (SqlDbType)Enum.Parse(typeof(SqlDbType), typeName, true); 909case SqlDbType.Binary: 910case SqlDbType.Char: 911case SqlDbType.NChar: 912case SqlDbType.NVarChar: 913case SqlDbType.VarBinary: 914case SqlDbType.VarChar: 916case SqlDbType.Decimal: 917case SqlDbType.Real: 918case SqlDbType.Float: 920case SqlDbType.Timestamp: 936protected ProviderType GetBestType(SqlDbType targetType, int? size) 942case SqlDbType.NChar: 943case SqlDbType.NVarChar: 946case SqlDbType.Char: 947case SqlDbType.VarChar: 948case SqlDbType.Binary: 949case SqlDbType.VarBinary: 1023case SqlDbType.Image: 1024case SqlDbType.Binary: 1025case SqlDbType.VarChar: 1027case SqlDbType.NVarChar: 1153case SqlDbType.TinyInt: 1154case SqlDbType.SmallInt: 1155case SqlDbType.Int: 1157case SqlDbType.SmallMoney: 1158case SqlDbType.Money: 1159return Create(SqlDbType.Money); 1160case SqlDbType.Real: 1161case SqlDbType.Float: 1163case SqlDbType.Date: 1164case SqlDbType.Time: 1165case SqlDbType.SmallDateTime: 1166case SqlDbType.DateTime: 1167case SqlDbType.DateTime2: 1169case SqlDbType.DateTimeOffset: 1203case SqlDbType.NVarChar: 1204case SqlDbType.VarChar: 1205case SqlDbType.VarBinary: 1207return Create(SqlDbType.BigInt); 1210return Create(SqlDbType.Int); 1213return Create(SqlDbType.Int); 1222case SqlDbType.TinyInt: 1223case SqlDbType.Int: 1224case SqlDbType.SmallInt: 1225return Create(SqlDbType.Int); 1226case SqlDbType.Float: 1227case SqlDbType.Real: 1228return Create(SqlDbType.Float); 1235return Create(SqlDbType.BigInt); 1236return Create(SqlDbType.Int); 1243case SqlDbType.NVarChar: 1244case SqlDbType.NChar: 1245case SqlDbType.VarChar: 1246case SqlDbType.Char: 1254case SqlDbType.NVarChar: 1255case SqlDbType.NChar: 1256return Create(SqlDbType.NVarChar); 1257case SqlDbType.VarChar: 1258case SqlDbType.Char: 1259return Create(SqlDbType.VarChar); 1306case SqlDbType.NChar: 1307return Create(SqlDbType.Int); 1308case SqlDbType.Char: 1309return Create(SqlDbType.SmallInt); 1335if (sqlTypeA.HasPrecisionAndScale && sqlTypeB.HasPrecisionAndScale && bestType.SqlDbType == SqlDbType.Decimal) { 1419return Create(SqlDbType.Bit); 1421return Create(SqlDbType.TinyInt); 1424return Create(SqlDbType.SmallInt); 1427return Create(SqlDbType.Int); 1430return Create(SqlDbType.BigInt); 1432return Create(SqlDbType.Decimal, 20, 0); 1434return Create(SqlDbType.Decimal, 29, size ?? 4); 1436return Create(SqlDbType.Float); 1438return Create(SqlDbType.Real); 1440return Create(SqlDbType.NChar, 1); 1442return GetBestType(SqlDbType.NVarChar, size); 1444return Create(SqlDbType.DateTime); 1447return Create(SqlDbType.UniqueIdentifier); 1449return GetBestType(SqlDbType.VarBinary, size); 1451return GetBestType(SqlDbType.NVarChar, size); 1453return Create(SqlDbType.BigInt); 1468case SqlDbType.NText: 1469case SqlDbType.NChar: 1470case SqlDbType.NVarChar: 1471return Create(SqlDbType.NVarChar, LargeTypeSizeIndicator); 1472case SqlDbType.Text: 1473case SqlDbType.Char: 1474case SqlDbType.VarChar: 1475return Create(SqlDbType.VarChar, LargeTypeSizeIndicator); 1476case SqlDbType.Image: 1477case SqlDbType.Binary: 1478case SqlDbType.VarBinary: 1479return Create(SqlDbType.VarBinary, LargeTypeSizeIndicator); 1524return Create(SqlDbType.DateTimeOffset); 1539return Create(SqlDbType.Bit); 1541return Create(SqlDbType.TinyInt); 1544return Create(SqlDbType.SmallInt); 1547return Create(SqlDbType.Int); 1550return Create(SqlDbType.BigInt); 1552return Create(SqlDbType.Decimal, 20, 0); 1554return Create(SqlDbType.Decimal, 29, size ?? 4); 1556return Create(SqlDbType.Float); 1558return Create(SqlDbType.Real); 1560return Create(SqlDbType.NChar, 1); 1562return GetBestType(SqlDbType.NVarChar, size); 1564return Create(SqlDbType.DateTime); 1567return Create(SqlDbType.UniqueIdentifier); 1569return GetBestType(SqlDbType.VarBinary, size); 1571return GetBestType(SqlDbType.NVarChar, size); 1573return Create(SqlDbType.BigInt); 1588case SqlDbType.NChar: 1589case SqlDbType.NVarChar: 1590return Create(SqlDbType.NText); 1591case SqlDbType.Char: 1592case SqlDbType.VarChar: 1593return Create(SqlDbType.Text); 1594case SqlDbType.Binary: 1595case SqlDbType.VarBinary: 1596return Create(SqlDbType.Image);
System.Web (287)
Cache\SqlCacheDependency.cs (1)
1501sqlCmd.Parameters.Add(new SqlParameter("@tableName", SqlDbType.NVarChar, table.Length));
Management\SqlWebEventProvider.cs (15)
103sqlCommand.Parameters.Add(new SqlParameter("@EventId", SqlDbType.Char, 32)); 104sqlCommand.Parameters.Add(new SqlParameter("@EventTimeUtc", SqlDbType.DateTime)); 105sqlCommand.Parameters.Add(new SqlParameter("@EventTime", SqlDbType.DateTime)); 106sqlCommand.Parameters.Add(new SqlParameter("@EventType", SqlDbType.NVarChar, 256)); 107sqlCommand.Parameters.Add(new SqlParameter("@EventSequence", SqlDbType.Decimal)); 108sqlCommand.Parameters.Add(new SqlParameter("@EventOccurrence", SqlDbType.Decimal)); 109sqlCommand.Parameters.Add(new SqlParameter("@EventCode", SqlDbType.Int)); 110sqlCommand.Parameters.Add(new SqlParameter("@EventDetailCode", SqlDbType.Int)); 111sqlCommand.Parameters.Add(new SqlParameter("@Message", SqlDbType.NVarChar, 1024)); 112sqlCommand.Parameters.Add(new SqlParameter("@ApplicationPath", SqlDbType.NVarChar, 256)); 113sqlCommand.Parameters.Add(new SqlParameter("@ApplicationVirtualPath", SqlDbType.NVarChar, 256)); 114sqlCommand.Parameters.Add(new SqlParameter("@MachineName", SqlDbType.NVarChar, 256)); 115sqlCommand.Parameters.Add(new SqlParameter("@RequestUrl", SqlDbType.NVarChar, 1024)); 116sqlCommand.Parameters.Add(new SqlParameter("@ExceptionType", SqlDbType.NVarChar, 256)); 117sqlCommand.Parameters.Add(new SqlParameter("@Details", SqlDbType.NText));
Profile\SqlProfileProvider.cs (27)
167cmd.Parameters.Add(CreateInputParam("@ApplicationName", SqlDbType.NVarChar, ApplicationName)); 168cmd.Parameters.Add(CreateInputParam("@UserName", SqlDbType.NVarChar, userName)); 169cmd.Parameters.Add(CreateInputParam("@CurrentTimeUtc", SqlDbType.DateTime, DateTime.UtcNow)); 232cmd.Parameters.Add(CreateInputParam("@ApplicationName", SqlDbType.NVarChar, ApplicationName)); 233cmd.Parameters.Add(CreateInputParam("@UserName", SqlDbType.NVarChar, username)); 234cmd.Parameters.Add(CreateInputParam("@PropertyNames", SqlDbType.NText, names)); 235cmd.Parameters.Add(CreateInputParam("@PropertyValuesString", SqlDbType.NText, values)); 236cmd.Parameters.Add(CreateInputParam("@PropertyValuesBinary", SqlDbType.Image, buf)); 237cmd.Parameters.Add(CreateInputParam("@IsUserAnonymous", SqlDbType.Bit, !userIsAuthenticated)); 238cmd.Parameters.Add(CreateInputParam("@CurrentTimeUtc", SqlDbType.DateTime, DateTime.UtcNow)); 257private SqlParameter CreateInputParam(string paramName, SqlDbType dbType, object objValue){ 342cmd.Parameters.Add(CreateInputParam("@ApplicationName", SqlDbType.NVarChar, ApplicationName)); 343cmd.Parameters.Add(CreateInputParam("@UserNames", SqlDbType.NVarChar, allUsers)); 390cmd.Parameters.Add(CreateInputParam("@ApplicationName", SqlDbType.NVarChar, ApplicationName)); 391cmd.Parameters.Add(CreateInputParam("@ProfileAuthOptions", SqlDbType.Int, (int) authenticationOption)); 392cmd.Parameters.Add(CreateInputParam("@InactiveSinceDate", SqlDbType.DateTime, userInactiveSinceDate.ToUniversalTime())); 424cmd.Parameters.Add(CreateInputParam("@ApplicationName", SqlDbType.NVarChar, ApplicationName)); 425cmd.Parameters.Add(CreateInputParam("@ProfileAuthOptions", SqlDbType.Int, (int) authenticationOption)); 426cmd.Parameters.Add(CreateInputParam("@InactiveSinceDate", SqlDbType.DateTime, userInactiveSinceDate.ToUniversalTime())); 457args[0] = CreateInputParam("@InactiveSinceDate", SqlDbType.DateTime, userInactiveSinceDate.ToUniversalTime()); 466args[0] = CreateInputParam("@UserNameToMatch", SqlDbType.NVarChar, usernameToMatch); 476args[0] = CreateInputParam("@UserNameToMatch", SqlDbType.NVarChar, usernameToMatch); 477args[1] = CreateInputParam("@InactiveSinceDate", SqlDbType.DateTime, userInactiveSinceDate.ToUniversalTime()); 511cmd.Parameters.Add(CreateInputParam("@ApplicationName", SqlDbType.NVarChar, ApplicationName)); 512cmd.Parameters.Add(CreateInputParam("@ProfileAuthOptions", SqlDbType.Int, (int) authenticationOption)); 513cmd.Parameters.Add(CreateInputParam("@PageIndex", SqlDbType.Int, pageIndex)); 514cmd.Parameters.Add(CreateInputParam("@PageSize", SqlDbType.Int, pageSize));
Security\SQLMembershipProvider.cs (106)
365cmd.Parameters.Add(CreateInputParam("@ApplicationName", SqlDbType.NVarChar, ApplicationName)); 366cmd.Parameters.Add(CreateInputParam("@UserName", SqlDbType.NVarChar, username)); 367cmd.Parameters.Add(CreateInputParam("@Password", SqlDbType.NVarChar, pass)); 368cmd.Parameters.Add(CreateInputParam("@PasswordSalt", SqlDbType.NVarChar, salt)); 369cmd.Parameters.Add(CreateInputParam("@Email", SqlDbType.NVarChar, email)); 370cmd.Parameters.Add(CreateInputParam("@PasswordQuestion", SqlDbType.NVarChar, passwordQuestion)); 371cmd.Parameters.Add(CreateInputParam("@PasswordAnswer", SqlDbType.NVarChar, encodedPasswordAnswer)); 372cmd.Parameters.Add(CreateInputParam("@IsApproved", SqlDbType.Bit, isApproved)); 373cmd.Parameters.Add(CreateInputParam("@UniqueEmail", SqlDbType.Int, RequiresUniqueEmail ? 1 : 0)); 374cmd.Parameters.Add(CreateInputParam("@PasswordFormat", SqlDbType.Int, (int)PasswordFormat)); 375cmd.Parameters.Add(CreateInputParam("@CurrentTimeUtc", SqlDbType.DateTime, dt)); 376SqlParameter p = CreateInputParam("@UserId", SqlDbType.UniqueIdentifier, providerUserKey); 380p = new SqlParameter("@ReturnValue", SqlDbType.Int); 468cmd.Parameters.Add(CreateInputParam("@ApplicationName", SqlDbType.NVarChar, ApplicationName)); 469cmd.Parameters.Add(CreateInputParam("@UserName", SqlDbType.NVarChar, username)); 470cmd.Parameters.Add(CreateInputParam("@NewPasswordQuestion", SqlDbType.NVarChar, newPasswordQuestion)); 471cmd.Parameters.Add(CreateInputParam("@NewPasswordAnswer", SqlDbType.NVarChar, encodedPasswordAnswer)); 473SqlParameter p = new SqlParameter("@ReturnValue", SqlDbType.Int); 625cmd.Parameters.Add(CreateInputParam("@ApplicationName", SqlDbType.NVarChar, ApplicationName)); 626cmd.Parameters.Add(CreateInputParam("@UserName", SqlDbType.NVarChar, username)); 627cmd.Parameters.Add(CreateInputParam("@NewPassword", SqlDbType.NVarChar, pass)); 628cmd.Parameters.Add(CreateInputParam("@PasswordSalt", SqlDbType.NVarChar, salt)); 629cmd.Parameters.Add(CreateInputParam("@PasswordFormat", SqlDbType.Int, passwordFormat)); 630cmd.Parameters.Add(CreateInputParam("@CurrentTimeUtc", SqlDbType.DateTime, DateTime.UtcNow)); 632SqlParameter p = new SqlParameter("@ReturnValue", SqlDbType.Int); 745cmd.Parameters.Add(CreateInputParam("@ApplicationName", SqlDbType.NVarChar, ApplicationName)); 746cmd.Parameters.Add(CreateInputParam("@UserName", SqlDbType.NVarChar, username)); 747cmd.Parameters.Add(CreateInputParam("@NewPassword", SqlDbType.NVarChar, EncodePassword(newPassword, (int) passwordFormat, salt))); 748cmd.Parameters.Add(CreateInputParam("@MaxInvalidPasswordAttempts", SqlDbType.Int, MaxInvalidPasswordAttempts ) ); 749cmd.Parameters.Add(CreateInputParam("@PasswordAttemptWindow", SqlDbType.Int, PasswordAttemptWindow ) ); 750cmd.Parameters.Add(CreateInputParam("@PasswordSalt", SqlDbType.NVarChar, salt)); 751cmd.Parameters.Add(CreateInputParam("@PasswordFormat", SqlDbType.Int, (int)passwordFormat)); 752cmd.Parameters.Add(CreateInputParam("@CurrentTimeUtc", SqlDbType.DateTime, DateTime.UtcNow)); 754cmd.Parameters.Add(CreateInputParam("@PasswordAnswer", SqlDbType.NVarChar, encodedPasswordAnswer)); 757SqlParameter p = new SqlParameter("@ReturnValue", SqlDbType.Int); 825cmd.Parameters.Add(CreateInputParam("@ApplicationName", SqlDbType.NVarChar, ApplicationName)); 826cmd.Parameters.Add(CreateInputParam("@UserName", SqlDbType.NVarChar, user.UserName)); 827cmd.Parameters.Add(CreateInputParam("@Email", SqlDbType.NVarChar, user.Email)); 828cmd.Parameters.Add(CreateInputParam("@Comment", SqlDbType.NText, user.Comment)); 829cmd.Parameters.Add(CreateInputParam("@IsApproved", SqlDbType.Bit, user.IsApproved ? 1 : 0)); 830cmd.Parameters.Add(CreateInputParam("@LastLoginDate", SqlDbType.DateTime, user.LastLoginDate.ToUniversalTime())); 831cmd.Parameters.Add(CreateInputParam("@LastActivityDate", SqlDbType.DateTime, user.LastActivityDate.ToUniversalTime())); 832cmd.Parameters.Add(CreateInputParam("@UniqueEmail", SqlDbType.Int, RequiresUniqueEmail ? 1 : 0)); 833cmd.Parameters.Add(CreateInputParam("@CurrentTimeUtc", SqlDbType.DateTime, DateTime.UtcNow)); 835SqlParameter p = new SqlParameter("@ReturnValue", SqlDbType.Int); 890cmd.Parameters.Add(CreateInputParam("@ApplicationName", SqlDbType.NVarChar, ApplicationName)); 891cmd.Parameters.Add(CreateInputParam("@UserName", SqlDbType.NVarChar, username)); 893SqlParameter p = new SqlParameter("@ReturnValue", SqlDbType.Int); 942cmd.Parameters.Add(CreateInputParam("@UserId", SqlDbType.UniqueIdentifier, providerUserKey ) ); 943cmd.Parameters.Add(CreateInputParam("@UpdateLastActivity", SqlDbType.Bit, userIsOnline)); 944cmd.Parameters.Add(CreateInputParam("@CurrentTimeUtc", SqlDbType.DateTime, DateTime.UtcNow)); 945SqlParameter p = new SqlParameter("@ReturnValue", SqlDbType.Int); 1030cmd.Parameters.Add(CreateInputParam("@ApplicationName", SqlDbType.NVarChar, ApplicationName)); 1031cmd.Parameters.Add(CreateInputParam("@UserName", SqlDbType.NVarChar, username)); 1032cmd.Parameters.Add(CreateInputParam("@UpdateLastActivity", SqlDbType.Bit, userIsOnline)); 1033cmd.Parameters.Add(CreateInputParam("@CurrentTimeUtc", SqlDbType.DateTime, DateTime.UtcNow)); 1034SqlParameter p = new SqlParameter("@ReturnValue", SqlDbType.Int); 1121cmd.Parameters.Add(CreateInputParam("@ApplicationName", SqlDbType.NVarChar, ApplicationName)); 1122cmd.Parameters.Add(CreateInputParam("@Email", SqlDbType.NVarChar, email)); 1124SqlParameter p = new SqlParameter("@ReturnValue", SqlDbType.Int); 1175cmd.Parameters.Add(CreateInputParam("@ApplicationName", SqlDbType.NVarChar, ApplicationName)); 1176cmd.Parameters.Add(CreateInputParam("@UserName", SqlDbType.NVarChar, username)); 1180cmd.Parameters.Add(CreateInputParam("@TablesToDeleteFrom", SqlDbType.Int, 0xF)); 1184cmd.Parameters.Add(CreateInputParam("@TablesToDeleteFrom", SqlDbType.Int, 1)); 1187SqlParameter p = new SqlParameter("@NumTablesDeletedFrom", SqlDbType.Int); 1236SqlParameter p = new SqlParameter("@ReturnValue", SqlDbType.Int); 1240cmd.Parameters.Add(CreateInputParam("@ApplicationName", SqlDbType.NVarChar, ApplicationName)); 1241cmd.Parameters.Add(CreateInputParam("@PageIndex", SqlDbType.Int, pageIndex)); 1242cmd.Parameters.Add(CreateInputParam("@PageSize", SqlDbType.Int, pageSize)); 1318SqlParameter p = new SqlParameter("@ReturnValue", SqlDbType.Int); 1322cmd.Parameters.Add(CreateInputParam("@ApplicationName", SqlDbType.NVarChar, ApplicationName)); 1323cmd.Parameters.Add(CreateInputParam("@MinutesSinceLastInActive", SqlDbType.Int, Membership.UserIsOnlineTimeWindow)); 1324cmd.Parameters.Add(CreateInputParam("@CurrentTimeUtc", SqlDbType.DateTime, DateTime.UtcNow)); 1365SqlParameter p = new SqlParameter("@ReturnValue", SqlDbType.Int); 1377cmd.Parameters.Add(CreateInputParam("@ApplicationName", SqlDbType.NVarChar, ApplicationName)); 1378cmd.Parameters.Add(CreateInputParam("@UserNameToMatch", SqlDbType.NVarChar, usernameToMatch)); 1379cmd.Parameters.Add(CreateInputParam("@PageIndex", SqlDbType.Int, pageIndex)); 1380cmd.Parameters.Add(CreateInputParam("@PageSize", SqlDbType.Int, pageSize)); 1463SqlParameter p = new SqlParameter("@ReturnValue", SqlDbType.Int); 1475cmd.Parameters.Add(CreateInputParam("@ApplicationName", SqlDbType.NVarChar, ApplicationName)); 1476cmd.Parameters.Add(CreateInputParam("@EmailToMatch", SqlDbType.NVarChar, emailToMatch)); 1477cmd.Parameters.Add(CreateInputParam("@PageIndex", SqlDbType.Int, pageIndex)); 1478cmd.Parameters.Add(CreateInputParam("@PageSize", SqlDbType.Int, pageSize)); 1585cmd.Parameters.Add( CreateInputParam( "@ApplicationName", SqlDbType.NVarChar, ApplicationName ) ); 1586cmd.Parameters.Add( CreateInputParam( "@UserName", SqlDbType.NVarChar, username ) ); 1587cmd.Parameters.Add( CreateInputParam( "@IsPasswordCorrect", SqlDbType.Bit, isPasswordCorrect ) ); 1588cmd.Parameters.Add( CreateInputParam( "@UpdateLastLoginActivityDate", SqlDbType.Bit, updateLastLoginActivityDate ) ); 1589cmd.Parameters.Add( CreateInputParam( "@MaxInvalidPasswordAttempts", SqlDbType.Int, MaxInvalidPasswordAttempts ) ); 1590cmd.Parameters.Add( CreateInputParam( "@PasswordAttemptWindow", SqlDbType.Int, PasswordAttemptWindow ) ); 1591cmd.Parameters.Add( CreateInputParam( "@CurrentTimeUtc", SqlDbType.DateTime, dtNow)); 1592cmd.Parameters.Add( CreateInputParam( "@LastLoginDate", SqlDbType.DateTime, isPasswordCorrect ? dtNow : lastLoginDate)); 1593cmd.Parameters.Add( CreateInputParam( "@LastActivityDate", SqlDbType.DateTime, isPasswordCorrect ? dtNow : lastActivityDate)); 1594SqlParameter p = new SqlParameter("@ReturnValue", SqlDbType.Int); 1646cmd.Parameters.Add(CreateInputParam( "@ApplicationName", SqlDbType.NVarChar, ApplicationName ) ); 1647cmd.Parameters.Add(CreateInputParam( "@UserName", SqlDbType.NVarChar, username ) ); 1648cmd.Parameters.Add(CreateInputParam("@UpdateLastLoginActivityDate", SqlDbType.Bit, updateLastLoginActivityDate)); 1649cmd.Parameters.Add(CreateInputParam("@CurrentTimeUtc", SqlDbType.DateTime, DateTime.UtcNow)); 1651p = new SqlParameter( "@ReturnValue", SqlDbType.Int ); 1726cmd.Parameters.Add( CreateInputParam( "@ApplicationName", SqlDbType.NVarChar, ApplicationName ) ); 1727cmd.Parameters.Add( CreateInputParam( "@UserName", SqlDbType.NVarChar, username ) ); 1728cmd.Parameters.Add( CreateInputParam( "@MaxInvalidPasswordAttempts", SqlDbType.Int, MaxInvalidPasswordAttempts ) ); 1729cmd.Parameters.Add( CreateInputParam( "@PasswordAttemptWindow", SqlDbType.Int, PasswordAttemptWindow ) ); 1730cmd.Parameters.Add(CreateInputParam("@CurrentTimeUtc", SqlDbType.DateTime, DateTime.UtcNow)); 1734cmd.Parameters.Add( CreateInputParam( "@PasswordAnswer", SqlDbType.NVarChar, passwordAnswer ) ); 1737p = new SqlParameter( "@ReturnValue", SqlDbType.Int ); 1819SqlDbType dbType,
Security\SQLRoleProvider.cs (36)
118SqlParameter p = new SqlParameter("@ReturnValue", SqlDbType.Int); 121cmd.Parameters.Add(CreateInputParam("@ApplicationName", SqlDbType.NVarChar, ApplicationName)); 122cmd.Parameters.Add(CreateInputParam("@UserName", SqlDbType.NVarChar, username)); 123cmd.Parameters.Add(CreateInputParam("@RoleName", SqlDbType.NVarChar, roleName)); 173SqlParameter p = new SqlParameter("@ReturnValue", SqlDbType.Int); 182cmd.Parameters.Add(CreateInputParam("@ApplicationName", SqlDbType.NVarChar, ApplicationName)); 183cmd.Parameters.Add(CreateInputParam("@UserName", SqlDbType.NVarChar, username)); 248SqlParameter p = new SqlParameter("@ReturnValue", SqlDbType.Int); 252cmd.Parameters.Add(CreateInputParam("@ApplicationName", SqlDbType.NVarChar, ApplicationName)); 253cmd.Parameters.Add(CreateInputParam("@RoleName", SqlDbType.NVarChar, roleName)); 302SqlParameter p = new SqlParameter("@ReturnValue", SqlDbType.Int); 305cmd.Parameters.Add(CreateInputParam("@ApplicationName", SqlDbType.NVarChar, ApplicationName)); 306cmd.Parameters.Add(CreateInputParam("@RoleName", SqlDbType.NVarChar, roleName)); 307cmd.Parameters.Add(CreateInputParam("@DeleteOnlyIfRoleIsEmpty", SqlDbType.Bit, throwOnPopulatedRole ? 1 : 0)); 353SqlParameter p = new SqlParameter("@ReturnValue", SqlDbType.Int); 356cmd.Parameters.Add(CreateInputParam("@ApplicationName", SqlDbType.NVarChar, ApplicationName)); 357cmd.Parameters.Add(CreateInputParam("@RoleName", SqlDbType.NVarChar, roleName)); 463SqlParameter p = new SqlParameter("@ReturnValue", SqlDbType.Int); 471cmd.Parameters.Add(CreateInputParam("@ApplicationName", SqlDbType.NVarChar, ApplicationName)); 472cmd.Parameters.Add(CreateInputParam("@RoleNames", SqlDbType.NVarChar, roleNames)); 473cmd.Parameters.Add(CreateInputParam("@UserNames", SqlDbType.NVarChar, usernames)); 474cmd.Parameters.Add(CreateInputParam("@CurrentTimeUtc", SqlDbType.DateTime, DateTime.UtcNow)); 575SqlParameter p = new SqlParameter("@ReturnValue", SqlDbType.Int); 583cmd.Parameters.Add(CreateInputParam("@ApplicationName", SqlDbType.NVarChar, ApplicationName)); 584cmd.Parameters.Add(CreateInputParam("@UserNames", SqlDbType.NVarChar, usernames)); 585cmd.Parameters.Add(CreateInputParam("@RoleNames", SqlDbType.NVarChar, roleNames)); 630SqlParameter p = new SqlParameter("@ReturnValue", SqlDbType.Int); 638cmd.Parameters.Add(CreateInputParam("@ApplicationName", SqlDbType.NVarChar, ApplicationName)); 639cmd.Parameters.Add(CreateInputParam("@RoleName", SqlDbType.NVarChar, roleName)); 699SqlParameter p = new SqlParameter("@ReturnValue", SqlDbType.Int); 707cmd.Parameters.Add(CreateInputParam("@ApplicationName", SqlDbType.NVarChar, ApplicationName)); 759SqlParameter p = new SqlParameter("@ReturnValue", SqlDbType.Int); 767cmd.Parameters.Add(CreateInputParam("@ApplicationName", SqlDbType.NVarChar, ApplicationName)); 768cmd.Parameters.Add(CreateInputParam("@RoleName", SqlDbType.NVarChar, roleName)); 769cmd.Parameters.Add(CreateInputParam("@UserNameToMatch", SqlDbType.NVarChar, usernameToMatch)); 836private SqlParameter CreateInputParam(string paramName, SqlDbType dbType, object objValue){
State\sqlstateclientmanager.cs (57)
1031p = cmd.Parameters.Add(new SqlParameter("@@ver", SqlDbType.Int)); 1074p = cmdTempGetAppId.Parameters.Add(new SqlParameter("@appName", SqlDbType.VarChar, APPID_MAX)); 1077p = cmdTempGetAppId.Parameters.Add(new SqlParameter("@appId", SqlDbType.Int)); 1289_cmdTempGet.Parameters.Add(new SqlParameter("@id", SqlDbType.NVarChar, ID_LENGTH)); 1290p = _cmdTempGet.Parameters.Add(new SqlParameter("@itemShort", SqlDbType.VarBinary, ITEM_SHORT_LENGTH)); 1292p = _cmdTempGet.Parameters.Add(new SqlParameter("@locked", SqlDbType.Bit)); 1294p = _cmdTempGet.Parameters.Add(new SqlParameter("@lockAge", SqlDbType.Int)); 1296p = _cmdTempGet.Parameters.Add(new SqlParameter("@lockCookie", SqlDbType.Int)); 1298p = _cmdTempGet.Parameters.Add(new SqlParameter("@actionFlags", SqlDbType.Int)); 1302_cmdTempGet.Parameters.Add(new SqlParameter("@id", SqlDbType.NVarChar, ID_LENGTH)); 1303p = _cmdTempGet.Parameters.Add(new SqlParameter("@itemShort", SqlDbType.VarBinary, ITEM_SHORT_LENGTH)); 1305p = _cmdTempGet.Parameters.Add(new SqlParameter("@locked", SqlDbType.Bit)); 1307p = _cmdTempGet.Parameters.Add(new SqlParameter("@lockDate", SqlDbType.DateTime)); 1309p = _cmdTempGet.Parameters.Add(new SqlParameter("@lockCookie", SqlDbType.Int)); 1311p = _cmdTempGet.Parameters.Add(new SqlParameter("@actionFlags", SqlDbType.Int)); 1331_cmdTempGetExclusive.Parameters.Add(new SqlParameter("@id", SqlDbType.NVarChar, ID_LENGTH)); 1332p = _cmdTempGetExclusive.Parameters.Add(new SqlParameter("@itemShort", SqlDbType.VarBinary, ITEM_SHORT_LENGTH)); 1334p = _cmdTempGetExclusive.Parameters.Add(new SqlParameter("@locked", SqlDbType.Bit)); 1336p = _cmdTempGetExclusive.Parameters.Add(new SqlParameter("@lockAge", SqlDbType.Int)); 1338p = _cmdTempGetExclusive.Parameters.Add(new SqlParameter("@lockCookie", SqlDbType.Int)); 1340p = _cmdTempGetExclusive.Parameters.Add(new SqlParameter("@actionFlags", SqlDbType.Int)); 1344_cmdTempGetExclusive.Parameters.Add(new SqlParameter("@id", SqlDbType.NVarChar, ID_LENGTH)); 1345p = _cmdTempGetExclusive.Parameters.Add(new SqlParameter("@itemShort", SqlDbType.VarBinary, ITEM_SHORT_LENGTH)); 1347p = _cmdTempGetExclusive.Parameters.Add(new SqlParameter("@locked", SqlDbType.Bit)); 1349p = _cmdTempGetExclusive.Parameters.Add(new SqlParameter("@lockDate", SqlDbType.DateTime)); 1351p = _cmdTempGetExclusive.Parameters.Add(new SqlParameter("@lockCookie", SqlDbType.Int)); 1353p = _cmdTempGetExclusive.Parameters.Add(new SqlParameter("@actionFlags", SqlDbType.Int)); 1369_cmdTempReleaseExclusive.Parameters.Add(new SqlParameter("@id", SqlDbType.NVarChar, ID_LENGTH)); 1370_cmdTempReleaseExclusive.Parameters.Add(new SqlParameter("@lockCookie", SqlDbType.Int)); 1383_cmdTempInsertLong.Parameters.Add(new SqlParameter("@id", SqlDbType.NVarChar, ID_LENGTH)); 1384_cmdTempInsertLong.Parameters.Add(new SqlParameter("@itemLong", SqlDbType.Image, 8000)); 1385_cmdTempInsertLong.Parameters.Add(new SqlParameter("@timeout", SqlDbType.Int)); 1399_cmdTempInsertShort.Parameters.Add(new SqlParameter("@id", SqlDbType.NVarChar, ID_LENGTH)); 1400_cmdTempInsertShort.Parameters.Add(new SqlParameter("@itemShort", SqlDbType.VarBinary, ITEM_SHORT_LENGTH)); 1401_cmdTempInsertShort.Parameters.Add(new SqlParameter("@timeout", SqlDbType.Int)); 1414_cmdTempUpdateLong.Parameters.Add(new SqlParameter("@id", SqlDbType.NVarChar, ID_LENGTH)); 1415_cmdTempUpdateLong.Parameters.Add(new SqlParameter("@itemLong", SqlDbType.Image, 8000)); 1416_cmdTempUpdateLong.Parameters.Add(new SqlParameter("@timeout", SqlDbType.Int)); 1417_cmdTempUpdateLong.Parameters.Add(new SqlParameter("@lockCookie", SqlDbType.Int)); 1431_cmdTempUpdateShort.Parameters.Add(new SqlParameter("@id", SqlDbType.NVarChar, ID_LENGTH)); 1432_cmdTempUpdateShort.Parameters.Add(new SqlParameter("@itemShort", SqlDbType.VarBinary, ITEM_SHORT_LENGTH)); 1433_cmdTempUpdateShort.Parameters.Add(new SqlParameter("@timeout", SqlDbType.Int)); 1434_cmdTempUpdateShort.Parameters.Add(new SqlParameter("@lockCookie", SqlDbType.Int)); 1448_cmdTempUpdateShortNullLong.Parameters.Add(new SqlParameter("@id", SqlDbType.NVarChar, ID_LENGTH)); 1449_cmdTempUpdateShortNullLong.Parameters.Add(new SqlParameter("@itemShort", SqlDbType.VarBinary, ITEM_SHORT_LENGTH)); 1450_cmdTempUpdateShortNullLong.Parameters.Add(new SqlParameter("@timeout", SqlDbType.Int)); 1451_cmdTempUpdateShortNullLong.Parameters.Add(new SqlParameter("@lockCookie", SqlDbType.Int)); 1464_cmdTempUpdateLongNullShort.Parameters.Add(new SqlParameter("@id", SqlDbType.NVarChar, ID_LENGTH)); 1465_cmdTempUpdateLongNullShort.Parameters.Add(new SqlParameter("@itemLong", SqlDbType.Image, 8000)); 1466_cmdTempUpdateLongNullShort.Parameters.Add(new SqlParameter("@timeout", SqlDbType.Int)); 1467_cmdTempUpdateLongNullShort.Parameters.Add(new SqlParameter("@lockCookie", SqlDbType.Int)); 1481_cmdTempRemove.Parameters.Add(new SqlParameter("@id", SqlDbType.NVarChar, ID_LENGTH)); 1482_cmdTempRemove.Parameters.Add(new SqlParameter("@lockCookie", SqlDbType.Int)); 1496_cmdTempInsertUninitializedItem.Parameters.Add(new SqlParameter("@id", SqlDbType.NVarChar, ID_LENGTH)); 1497_cmdTempInsertUninitializedItem.Parameters.Add(new SqlParameter("@itemShort", SqlDbType.VarBinary, ITEM_SHORT_LENGTH)); 1498_cmdTempInsertUninitializedItem.Parameters.Add(new SqlParameter("@timeout", SqlDbType.Int)); 1512_cmdTempResetTimeout.Parameters.Add(new SqlParameter("@id", SqlDbType.NVarChar, ID_LENGTH));
UI\WebControls\SqlDataSourceView.cs (2)
1226sqlParameter.SqlDbType = SqlDbType.Time; 1229sqlParameter.SqlDbType = SqlDbType.Date;
UI\WebParts\SqlPersonalizationProvider.cs (42)
63private SqlParameter CreateParameter(string name, SqlDbType dbType, object value) { 92SqlParameter parameter = parameters.Add(new SqlParameter("AllUsersScope", SqlDbType.Bit)); 99SqlParameter returnValue = new SqlParameter("@ReturnValue", SqlDbType.Int); 103parameter = parameters.Add("Path", SqlDbType.NVarChar); 108parameter = parameters.Add("UserName", SqlDbType.NVarChar); 109parameter = parameters.Add("InactiveSinceDate", SqlDbType.DateTime); 212SqlParameter parameter = parameters.Add(new SqlParameter("AllUsersScope", SqlDbType.Bit)); 219SqlParameter returnValue = new SqlParameter("@ReturnValue", SqlDbType.Int); 223parameter = parameters.Add("Path", SqlDbType.NVarChar); 228parameter = parameters.Add("UserName", SqlDbType.NVarChar); 233parameter = parameters.Add("InactiveSinceDate", SqlDbType.DateTime); 318SqlParameter parameter = parameters.Add(new SqlParameter("Count", SqlDbType.Int)); 321parameter = parameters.Add(new SqlParameter("AllUsersScope", SqlDbType.Bit)); 326parameter = parameters.Add("Path", SqlDbType.NVarChar); 331parameter = parameters.Add("UserName", SqlDbType.NVarChar); 332parameter = parameters.Add("InactiveSinceDate", SqlDbType.DateTime); 394SqlParameter parameter = parameters.Add(new SqlParameter("Count", SqlDbType.Int)); 397parameter = parameters.Add(new SqlParameter("AllUsersScope", SqlDbType.Bit)); 402parameter = parameters.Add("Path", SqlDbType.NVarChar); 407parameter = parameters.Add("UserName", SqlDbType.NVarChar); 412parameter = parameters.Add("InactiveSinceDate", SqlDbType.DateTime); 517command.Parameters.Add(CreateParameter("@ApplicationName", SqlDbType.NVarChar, this.ApplicationName)); 518command.Parameters.Add(CreateParameter("@Path", SqlDbType.NVarChar, path)); 520command.Parameters.Add(CreateParameter("@UserName", SqlDbType.NVarChar, userName)); 521command.Parameters.Add(CreateParameter("@CurrentTimeUtc", SqlDbType.DateTime, DateTime.UtcNow)); 593command.Parameters.Add(CreateParameter("@ApplicationName", SqlDbType.NVarChar, ApplicationName)); 594command.Parameters.Add(CreateParameter("@Path", SqlDbType.NVarChar, path)); 596command.Parameters.Add(CreateParameter("@UserName", SqlDbType.NVarChar, userName)); 597command.Parameters.Add(CreateParameter("@CurrentTimeUtc", SqlDbType.DateTime, DateTime.UtcNow)); 648SqlParameter parameter = parameters.Add(new SqlParameter("AllUsersScope", SqlDbType.Bit)); 653parameter = parameters.Add(new SqlParameter("Count", SqlDbType.Int)); 700SqlParameter parameter = parameters.Add(new SqlParameter("Count", SqlDbType.Int)); 705parameter = parameters.Add("Path", SqlDbType.NVarChar); 813SqlParameter parameter = parameters.Add(new SqlParameter("Count", SqlDbType.Int)); 824parameter = parameters.Add("InactiveSinceDate", SqlDbType.DateTime); 840parameter = parameters.Add("Path", SqlDbType.NVarChar); 861parameter = parameters.Add("UserName", SqlDbType.NVarChar); 919command.Parameters.Add(CreateParameter("@ApplicationName", SqlDbType.NVarChar, ApplicationName)); 920command.Parameters.Add(CreateParameter("@Path", SqlDbType.NVarChar, path)); 921command.Parameters.Add(CreateParameter("@PageSettings", SqlDbType.Image, state)); 922command.Parameters.Add(CreateParameter("@CurrentTimeUtc", SqlDbType.DateTime, DateTime.UtcNow)); 924command.Parameters.Add(CreateParameter("@UserName", SqlDbType.NVarChar, userName));
Util\SecUtil.cs (1)
278p = new SqlParameter("@ReturnValue", SqlDbType.Int);
System.Workflow.Runtime (14)
Hosting\DbResourceAllocator.cs (1)
249return new SqlParameter(parameterName, SqlDbType.BigInt);
Tracking\SqlTrackingQuery.cs (7)
174param.SqlDbType = SqlDbType.UniqueIdentifier; 190param.SqlDbType = SqlDbType.TinyInt; 199param.SqlDbType = SqlDbType.DateTime; 209param.SqlDbType = SqlDbType.DateTime; 222param.SqlDbType = SqlDbType.NVarChar; 227param.SqlDbType = SqlDbType.NVarChar; 276param.SqlDbType = SqlDbType.NText;
Tracking\SqlTrackingWorkflowInstance.cs (6)
765SqlParameter param = new SqlParameter("@WorkflowInstanceId", SqlDbType.UniqueIdentifier); 769param = new SqlParameter("@BeginDateTime", SqlDbType.DateTime); 773param = new SqlParameter("@EndDateTime", SqlDbType.DateTime); 857SqlParameter param = new SqlParameter("@WorkflowInstanceInternalId", SqlDbType.BigInt); 861param = new SqlParameter("@BeginDateTime", SqlDbType.DateTime); 865param = new SqlParameter("@EndDateTime", SqlDbType.DateTime);
System.WorkflowServices (27)
System\ServiceModel\Persistence\SqlPersistenceProviderFactory.cs (27)
769SqlParameter idParameter = new SqlParameter("@id", SqlDbType.UniqueIdentifier); 773SqlParameter instanceParameter = new SqlParameter("@instance", SqlDbType.Image); 774SqlParameter instanceXmlParameter = new SqlParameter("@instanceXml", SqlDbType.Xml); 790SqlParameter unlockInstanceParameter = new SqlParameter("@unlockInstance", SqlDbType.Bit); 794SqlParameter lockOwnerParameter = new SqlParameter("@hostId", SqlDbType.UniqueIdentifier); 798SqlParameter lockTimeoutParameter = new SqlParameter("@lockTimeout", SqlDbType.Int); 802SqlParameter resultParameter = new SqlParameter("@result", SqlDbType.Int); 846SqlParameter idParameter = new SqlParameter("@id", SqlDbType.UniqueIdentifier); 850SqlParameter hostIdParameter = new SqlParameter("@hostId", SqlDbType.UniqueIdentifier); 854SqlParameter lockTimeoutParameter = new SqlParameter("@lockTimeout", SqlDbType.Int); 858SqlParameter resultParameter = new SqlParameter("@result", SqlDbType.Int); 948SqlParameter idParameter = new SqlParameter("@id", SqlDbType.UniqueIdentifier); 952SqlParameter lockInstanceParameter = new SqlParameter("@lockInstance", SqlDbType.Bit); 956SqlParameter hostIdParameter = new SqlParameter("@hostId", SqlDbType.UniqueIdentifier); 960SqlParameter lockTimeoutParameter = new SqlParameter("@lockTimeout", SqlDbType.Int); 964SqlParameter resultParameter = new SqlParameter("@result", SqlDbType.Int); 1411SqlParameter idParameter = new SqlParameter("@id", SqlDbType.UniqueIdentifier); 1415SqlParameter hostIdParameter = new SqlParameter("@hostId", SqlDbType.UniqueIdentifier); 1419SqlParameter lockTimeoutParameter = new SqlParameter("@lockTimeout", SqlDbType.Int); 1423SqlParameter resultParameter = new SqlParameter("@result", SqlDbType.Int); 1470SqlParameter idParameter = new SqlParameter("@id", SqlDbType.UniqueIdentifier); 1474SqlParameter instanceParameter = new SqlParameter("@instance", SqlDbType.Image); 1475SqlParameter instanceXmlParameter = new SqlParameter("@instanceXml", SqlDbType.Xml); 1491SqlParameter unlockInstanceParameter = new SqlParameter("@unlockInstance", SqlDbType.Bit); 1495SqlParameter lockOwnerParameter = new SqlParameter("@hostId", SqlDbType.UniqueIdentifier); 1499SqlParameter lockTimeoutParameter = new SqlParameter("@lockTimeout", SqlDbType.Int); 1503SqlParameter resultParameter = new SqlParameter("@result", SqlDbType.Int);