208 references to SqlDbType
System.Data (208)
fx\src\data\Microsoft\SqlServer\Server\MetadataUtilsSmi.cs (14)
166
metaData.
SqlDbType
== SqlDbType.Image ||
167
metaData.
SqlDbType
== SqlDbType.NText ||
168
metaData.
SqlDbType
== SqlDbType.Text ||
169
metaData.
SqlDbType
== SqlDbType.Udt;
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
) {
488
source.
SqlDbType
,
502
source.
SqlDbType
,
573
return firstMd.
SqlDbType
== secondMd.SqlDbType &&
580
firstMd.
SqlDbType
!= SqlDbType.Structured && // SqlMetaData doesn't support Structured types
fx\src\data\Microsoft\SqlServer\Server\SmiMetaData.cs (7)
135
DefaultChar_NoCollation.
SqlDbType
,
149
DefaultNChar_NoCollation.
SqlDbType
,
163
DefaultNText_NoCollation.
SqlDbType
,
177
DefaultNVarChar_NoCollation.
SqlDbType
,
191
DefaultText_NoCollation.
SqlDbType
,
205
DefaultVarChar_NoCollation.
SqlDbType
,
785
SqlDbType
,
fx\src\data\Microsoft\SqlServer\Server\SmiXetterAccessMap.cs (2)
108
return __isGetterAccessValid[(int) metaData.
SqlDbType
, (int) xetterType];
116
return __isSetterAccessValid[(int) metaData.
SqlDbType
, (int) xetterType];
fx\src\data\Microsoft\SqlServer\Server\SqlDataRecord.cs (1)
196
if (_usesStringStorageForXml && SqlDbType.Xml == colMeta.
SqlDbType
) {
fx\src\data\Microsoft\SqlServer\Server\SqlRecordBuffer.cs (7)
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,
370
Debug.Assert(value != null && (value.
SqlDbType
== SqlDbType.Money || value.
SqlDbType
== SqlDbType.NVarChar),
fx\src\data\Microsoft\SqlServer\Server\ValueUtilsSmi.cs (90)
105
length = CheckXetParameters( metaData.
SqlDbType
, metaData.MaxLength * sizeof(char), value.Length,
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
) {
134
CheckXetParameters( metaData.
SqlDbType
, metaData.MaxLength, 0, fieldOffset, buffer.Length, bufferOffset, length );
144
if (MetaDataUtilsSmi.IsCharOrXmlType(metaData.
SqlDbType
)) {
145
length = CheckXetParameters( metaData.
SqlDbType
, metaData.MaxLength * sizeof(char), actualLength,
149
length = CheckXetParameters( metaData.
SqlDbType
, metaData.MaxLength, actualLength, fieldOffset, buffer.Length, bufferOffset, length );
168
length = CheckXetParameters( metaData.
SqlDbType
, metaData.MaxLength, actualLength, fieldOffset, buffer.Length, bufferOffset, length );
183
length = CheckXetParameters( metaData.
SqlDbType
, metaData.MaxLength * sizeof(char), value.Length,
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))) {
807
switch (metaData.
SqlDbType
) {
811
Debug.Assert(SqlDbType.Variant != metaData.
SqlDbType
, "Variant-within-variant causes endless recursion!");
846
switch( metaData.
SqlDbType
) {
919
Debug.Assert( SqlDbType.Variant != metaData.
SqlDbType
, "Variant-within-variant causes endless recursion!" );
944
if (SqlDbType.Udt == metaData.
SqlDbType
) {
947
result = __typeSpecificNullForSqlValue[(int)metaData.
SqlDbType
];
950
switch (metaData.
SqlDbType
) {
954
Debug.Assert(SqlDbType.Variant != metaData.
SqlDbType
, "Variant-within-variant causes endless recursion!");
986
if (SqlDbType.Udt == metaData.
SqlDbType
) {
990
result = __typeSpecificNullForSqlValue[(int)metaData.
SqlDbType
];
994
switch( metaData.
SqlDbType
) {
1067
Debug.Assert( SqlDbType.Variant != metaData.
SqlDbType
, "Variant-within-variant causes endless recursion!" );
1134
if (SqlDbType.Udt == metaData.
SqlDbType
) {
1138
SqlBuffer.StorageType stype = SqlDbTypeToStorageType(metaData.
SqlDbType
);
1170
switch( metaData.
SqlDbType
)
1229
Debug.Assert( SqlDbType.Variant != metaData.
SqlDbType
, "Variant-within-variant not supposed to be possible!" );
1262
switch(metaData.
SqlDbType
) {
1268
Debug.Assert( SqlDbType.Variant != metaData.
SqlDbType
, "Variant-within-variant not supposed to be possible!" );
1354
length = CheckXetParameters( metaData.
SqlDbType
, metaData.MaxLength, NoLengthLimit /* actual */, fieldOffset, buffer.Length, bufferOffset, length );
1389
length = CheckXetParameters( metaData.
SqlDbType
, metaData.MaxLength, NoLengthLimit /* actual */, fieldOffset, buffer.Length, bufferOffset, length );
1660
CanAccessSetterDirectly(metaData, typeCode), "Un-validated type '" + typeCode + "' for metaData: " + metaData.
SqlDbType
);
1695
CanAccessSetterDirectly(metaData, typeCode), "Un-validated type '" + typeCode + "' for metaData: " + metaData.
SqlDbType
);
1727
switch ( metaData[i].
SqlDbType
) {
1835
Debug.Assert( false, "unsupported DbType:" + metaData[i].
SqlDbType
.ToString() );
1853
switch (metaData[i].
SqlDbType
) {
1971
ExtendedClrTypeCode typeCode = MetaDataUtilsSmi.DetermineExtendedTypeCodeForUseWithSqlDbType(metaData[i].
SqlDbType
, metaData[i].IsMultiValued, o, null,
2027
Debug.Assert(false, "unsupported DbType:" + metaData[i].
SqlDbType
.ToString());
2047
switch (metaData[i].
SqlDbType
) {
2148
Debug.Assert( false, "unsupported DbType:" + metaData[i].
SqlDbType
.ToString() );
2169
switch (metaData[i].
SqlDbType
)
2309
Debug.Assert(false, "unsupported DbType:" + metaData[i].
SqlDbType
.ToString());
2394
if (SqlDbType.Decimal == metaData.
SqlDbType
) {
2398
Debug.Assert( SqlDbType.Money == metaData.
SqlDbType
||
2399
SqlDbType.SmallMoney == metaData.
SqlDbType
,
2400
"Unexpected sqldbtype=" + metaData.
SqlDbType
);
2406
if (SqlDbType.Decimal == metaData.
SqlDbType
|| SqlDbType.Variant == metaData.
SqlDbType
) {
2410
Debug.Assert( SqlDbType.Money == metaData.
SqlDbType
||
2411
SqlDbType.SmallMoney == metaData.
SqlDbType
,
2412
"Unexpected sqldbtype=" + metaData.
SqlDbType
);
2435
VerifyDateTimeRange(metaData.
SqlDbType
, value);
2436
SetDateTime_Unchecked(sink, setters, ordinal, ((SqlDbType.Date == metaData.
SqlDbType
) ? value.Date : value));
2440
VerifyTimeRange(metaData.
SqlDbType
, value);
2446
VerifyDateTimeRange(metaData.
SqlDbType
, value.Value);
2453
VerifyDateTimeRange(metaData.
SqlDbType
, value);
2459
VerifyDateTimeRange(metaData.
SqlDbType
, value);
2464
if (!value.IsNull && SqlDbType.SmallMoney == metaData.
SqlDbType
) {
2474
int length = CheckXetParameters( metaData.
SqlDbType
, metaData.MaxLength, NoLengthLimit /* actual */, 0, buffer.Length, offset, buffer.Length - offset );
2480
int length = CheckXetParameters( metaData.
SqlDbType
, metaData.MaxLength, NoLengthLimit /* actual */, 0, buffer.Length, offset, buffer.Length - offset );
2488
length = CheckXetParameters( metaData.
SqlDbType
, metaData.MaxLength, NoLengthLimit /* actual */, 0, value.Length, offset, value.Length - offset );
2503
length = CheckXetParameters( metaData.
SqlDbType
, metaData.MaxLength, NoLengthLimit /* actual */, 0, checked( (int) bufferLength ), offset, checked( (int) bufferLength ) );
2538
length = CheckXetParameters(metaData.
SqlDbType
, metaData.MaxLength, NoLengthLimit /* actual */, 0, NoLengthLimit /* buffer length */, offset, NoLengthLimit /* requested length */ );
2572
length = CheckXetParameters( metaData.
SqlDbType
, metaData.MaxLength, NoLengthLimit /* actual */, 0, checked( (int) bufferLength ), offset, checked( (int) bufferLength ) );
2586
length = CheckXetParameters( metaData.
SqlDbType
, metaData.MaxLength, NoLengthLimit /* actual */, 0, checked( (int) bufferLength ), offset, checked( (int) bufferLength - offset ) );
2590
if (MetaDataUtilsSmi.IsAnsiType(metaData.
SqlDbType
)) {
2646
length = CheckXetParameters(metaData.
SqlDbType
, metaData.MaxLength, NoLengthLimit /* actual */, 0, NoLengthLimit /* buffer length */, offset, NoLengthLimit /* requested length */ );
2650
if (MetaDataUtilsSmi.IsAnsiType(metaData.
SqlDbType
)) {
2678
int length = CheckXetParameters(metaData.
SqlDbType
, metaData.MaxLength, value.Length, 0, NoLengthLimit /* buffer */, offset, NoLengthLimit /* request */);
2693
length = CheckXetParameters( metaData.
SqlDbType
, metaData.MaxLength, NoLengthLimit /* actual */, 0, checked( (int) bufferLength ), offset, checked( (int) bufferLength - offset ) );
2704
int length = CheckXetParameters( metaData.
SqlDbType
, metaData.MaxLength, NoLengthLimit /* actual */, 0, stringValue.Length, offset, stringValue.Length - offset );
2711
int length = CheckXetParameters( metaData.
SqlDbType
, metaData.MaxLength, NoLengthLimit /* actual */, 0, value.Length, offset, checked( value.Length - offset ) );
2748
Debug.Assert( SqlDbType.BigInt <= metaData.
SqlDbType
&& SqlDbType.DateTimeOffset >= metaData.
SqlDbType
);
2750
bool returnValue = __canAccessGetterDirectly[(int)setterTypeCode, (int)metaData.
SqlDbType
];
2768
Debug.Assert( SqlDbType.BigInt <= metaData.
SqlDbType
&& SqlDbType.DateTimeOffset >= metaData.
SqlDbType
);
2770
bool returnValue = __canAccessSetterDirectly[(int)setterTypeCode, (int)metaData.
SqlDbType
];
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
) {
3665
fieldMetaData.
SqlDbType
, fieldMetaData.IsMultiValued, cellValue, fieldMetaData.Type,
fx\src\data\System\Data\SqlClient\SqlCommand.cs (8)
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*/);
6224
MetaType mt = MetaType.GetMetaTypeFromSqlDbType(requestMetaData[index].
SqlDbType
, requestMetaData[index].IsMultiValued);
6252
if (value is XmlDataFeed && requestMetaData[index].
SqlDbType
!= SqlDbType.Xml) {
6255
ExtendedClrTypeCode typeCode = MetaDataUtilsSmi.DetermineExtendedTypeCodeForUseWithSqlDbType(requestMetaData[index].
SqlDbType
, requestMetaData[index].IsMultiValued, value, null /* parameters don't use CLR Type for UDTs */, SmiContextFactory.Instance.NegotiatedSmiVersion);
6269
switch(requestMetaData[index].
SqlDbType
) {
fx\src\data\System\Data\SqlClient\SqlDataReaderSmi.cs (25)
66
if ( SqlDbType.Udt == md.
SqlDbType
) {
76
if (SqlDbType.Udt == _currentMetaData[ordinal].
SqlDbType
) {
81
_currentMetaData[ordinal].
SqlDbType
, _currentMetaData[ordinal].IsMultiValued).ClassType ;
88
if (SqlDbType.Udt == _currentMetaData[ordinal].
SqlDbType
) {
93
_currentMetaData[ordinal].
SqlDbType
, _currentMetaData[ordinal].IsMultiValued).SqlType ;
153
return ValueUtilsSmi.SqlDbTypeToStorageType(valueMetaData.
SqlDbType
);
233
if (metaData.
SqlDbType
== SqlDbType.Xml) {
554
MetaType metaType = MetaType.GetMetaTypeFromSqlDbType(colMetaData.
SqlDbType
, colMetaData.IsMultiValued);
567
if (SqlDbType.Decimal == colMetaData.
SqlDbType
) {
571
else if (SqlDbType.Variant == colMetaData.
SqlDbType
) {
580
schemaRow[ProviderType] = (int) colMetaData.
SqlDbType
; // SqlDbType
581
schemaRow[NonVersionedProviderType] = (int) colMetaData.
SqlDbType
; // SqlDbType
583
if (colMetaData.
SqlDbType
!= SqlDbType.Udt) {
602
switch (colMetaData.
SqlDbType
) {
628
if ( SqlDbType.Decimal == colMetaData.
SqlDbType
||
629
SqlDbType.Time == colMetaData.
SqlDbType
||
630
SqlDbType.DateTime2 == colMetaData.
SqlDbType
||
631
SqlDbType.DateTimeOffset == colMetaData.
SqlDbType
) {
636
colMetaData.
SqlDbType
, colMetaData.IsMultiValued).Scale;
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\TdsParser.cs (7)
8767
MetaType mt = MetaType.GetMetaTypeFromSqlDbType(metaData.
SqlDbType
, metaData.IsMultiValued);
8780
if (SqlDbType.Structured == metaData.
SqlDbType
&& metaData.IsMultiValued) {
8800
metaData.
SqlDbType
, metaData.IsMultiValued, value, null, MSS.SmiContextFactory.KatmaiVersion);
8851
switch(metaData.
SqlDbType
) {
9017
Debug.Assert(SqlDbType.Structured == metaData.
SqlDbType
&& metaData.IsMultiValued,
9018
"Invalid metadata for TVPs. Type=" + metaData.
SqlDbType
);
9053
if (SqlDbType.Timestamp == md.
SqlDbType
) {
fx\src\data\System\Data\SqlClient\TdsRecordBufferSetter.cs (2)
42
Debug.Assert(SqlDbType.Structured == md.
SqlDbType
, "Unsupported SqlDbType: " + md.
SqlDbType
);
fx\src\data\System\Data\SqlClient\TdsValueSetter.cs (45)
66
switch(_metaData.
SqlDbType
) {
100
Debug.Assert(false, "PLP-only types shouldn't get to this point. Type: " + _metaData.
SqlDbType
);
109
Debug.Assert(false, "Unexpected SqlDbType: " + _metaData.
SqlDbType
);
119
if (SqlDbType.Variant == _metaData.
SqlDbType
) {
137
if (SqlDbType.Variant == _metaData.
SqlDbType
) {
179
Debug.Assert(!MetaType.GetMetaTypeFromSqlDbType(_metaData.
SqlDbType
, _metaData.IsMultiValued).IsLong,
180
"We're assuming long length types are sent as PLP. SqlDbType = " + _metaData.
SqlDbType
);
182
if (SqlDbType.Variant == _metaData.
SqlDbType
) {
203
Debug.Assert(!MetaType.GetMetaTypeFromSqlDbType(_metaData.
SqlDbType
, _metaData.IsMultiValued).IsLong,
204
"We're assuming long length types are sent as PLP. SqlDbType = " + _metaData.
SqlDbType
);
206
if (SqlDbType.Variant == _metaData.
SqlDbType
) {
232
if (MetaDataUtilsSmi.IsAnsiType(_metaData.
SqlDbType
)) {
262
if (SqlDbType.Variant == _metaData.
SqlDbType
) {
266
Debug.Assert(!MetaType.GetMetaTypeFromSqlDbType(_metaData.
SqlDbType
, _metaData.IsMultiValued).IsLong,
267
"We're assuming long length types are sent as PLP. SqlDbType = " + _metaData.
SqlDbType
);
292
Debug.Assert(!MetaType.GetMetaTypeFromSqlDbType(_metaData.
SqlDbType
, _metaData.IsMultiValued).IsLong,
293
"We're assuming long length types are sent as PLP. SqlDbType = " + _metaData.
SqlDbType
);
316
if (MetaDataUtilsSmi.IsAnsiType(_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