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