37 instantiations of MetaType
System.Data (37)
fx\src\data\System\Data\SqlClient\SqlEnums.cs (37)
706
private static readonly MetaType MetaBigInt = new
MetaType
709
private static readonly MetaType MetaFloat = new
MetaType
712
private static readonly MetaType MetaReal = new
MetaType
717
private static readonly MetaType MetaBinary = new
MetaType
721
private static readonly MetaType MetaTimestamp = new
MetaType
724
internal static readonly MetaType MetaVarBinary = new
MetaType
727
internal static readonly MetaType MetaMaxVarBinary = new
MetaType
733
private static readonly MetaType MetaSmallVarBinary = new
MetaType
736
internal static readonly MetaType MetaImage = new
MetaType
739
private static readonly MetaType MetaBit = new
MetaType
742
private static readonly MetaType MetaTinyInt = new
MetaType
745
private static readonly MetaType MetaSmallInt = new
MetaType
748
private static readonly MetaType MetaInt = new
MetaType
754
private static readonly MetaType MetaChar = new
MetaType
757
private static readonly MetaType MetaVarChar = new
MetaType
760
internal static readonly MetaType MetaMaxVarChar = new
MetaType
763
internal static readonly MetaType MetaText = new
MetaType
769
private static readonly MetaType MetaNChar = new
MetaType
772
internal static readonly MetaType MetaNVarChar = new
MetaType
775
internal static readonly MetaType MetaMaxNVarChar = new
MetaType
778
internal static readonly MetaType MetaNText = new
MetaType
784
internal static readonly MetaType MetaDecimal = new
MetaType
787
internal static readonly MetaType MetaXml = new
MetaType
790
private static readonly MetaType MetaDateTime = new
MetaType
793
private static readonly MetaType MetaSmallDateTime = new
MetaType
796
private static readonly MetaType MetaMoney = new
MetaType
799
private static readonly MetaType MetaSmallMoney = new
MetaType
802
private static readonly MetaType MetaUniqueId = new
MetaType
805
private static readonly MetaType MetaVariant = new
MetaType
808
internal static readonly MetaType MetaUdt = new
MetaType
811
private static readonly MetaType MetaMaxUdt = new
MetaType
814
private static readonly MetaType MetaTable = new
MetaType
819
private static readonly MetaType MetaSUDT = new
MetaType
822
private static readonly MetaType MetaDate = new
MetaType
825
internal static readonly MetaType MetaTime = new
MetaType
828
private static readonly MetaType MetaDateTime2 = new
MetaType
831
internal static readonly MetaType MetaDateTimeOffset = new
MetaType
189 references to MetaType
System.Data (189)
fx\src\data\Microsoft\SqlServer\Server\SqlDataRecord.cs (3)
57
return
MetaType
.GetMetaTypeFromSqlDbType(metaData.SqlDbType, false).TypeName;
68
return
MetaType
.GetMetaTypeFromSqlDbType(md.SqlDbType, false).ClassType;
246
return
MetaType
.GetMetaTypeFromSqlDbType(md.SqlDbType, false).SqlType;
fx\src\data\System\Data\SqlClient\SqlBulkCopy.cs (9)
1111
MetaType
mtSource = _SqlDataReaderRowSource.MetaData[sourceOrdinal].metaType;
1273
MetaType
metatype =
MetaType
.GetMetaTypeFromValue(value);
1294
return
MetaType
.GetComValueFromSqlVariant (value);
1313
MetaType
type = metadata.metaType;
1332
MetaType
mt;
1336
mt =
MetaType
.GetMetaTypeFromSqlDbType(type.SqlDbType, false);
1401
mt =
MetaType
.GetMetaTypeFromSqlDbType (type.SqlDbType, false);
1407
mt =
MetaType
.GetMetaTypeFromSqlDbType(type.SqlDbType, false);
fx\src\data\System\Data\SqlClient\SqlCommand.cs (10)
2852
p.SqlDbType =
MetaType
.GetSqlDbTypeFromOleDbType((short)r[colNames[(int)ProcParamsColIndex.DataType]],
2927
if (
MetaType
._IsVarTime(p.SqlDbType)) {
5248
MetaType
mt =
MetaType
.GetMetaTypeFromSqlDbType(rec.type, rec.isMultiValued);
5761
MetaType
mt = sqlParam.InternalMetaType;
6224
MetaType
mt =
MetaType
.GetMetaTypeFromSqlDbType(requestMetaData[index].SqlDbType, requestMetaData[index].IsMultiValued);
6253
value =
MetaType
.GetStringFromXml(((XmlDataFeed)value)._source);
6311
MetaType
mt =
MetaType
.GetMetaTypeFromValue(value);
fx\src\data\System\Data\SqlClient\SqlDataReader.cs (29)
602
schemaRow[Scale] =
MetaType
.MetaNVarChar.Scale;
1178
dataTypeName =
MetaType
.MetaNVarChar.TypeName;
1182
dataTypeName =
MetaType
.MetaMaxVarBinary.TypeName;
1186
dataTypeName =
MetaType
.MetaImage.TypeName;
1244
fieldType =
MetaType
.MetaNVarChar.ClassType;
1248
fieldType =
MetaType
.MetaMaxVarBinary.ClassType;
1252
fieldType =
MetaType
.MetaImage.ClassType;
1332
providerSpecificFieldType =
MetaType
.MetaNVarChar.SqlType;
1336
providerSpecificFieldType =
MetaType
.MetaMaxVarBinary.SqlType;
1340
providerSpecificFieldType =
MetaType
.MetaImage.SqlType;
1431
MetaType
mt = _metaData[i].metaType;
1469
MetaType
mt = _metaData[i].metaType;
1511
MetaType
mt = _metaData[i].metaType;
1874
MetaType
mt = null;
1944
MetaType
mt = null;
2719
private
MetaType
GetVersionedMetaType(
MetaType
actualMetaType) {
2722
MetaType
metaType = null;
2724
if (actualMetaType ==
MetaType
.MetaUdt) {
2725
metaType =
MetaType
.MetaVarBinary;
2727
else if (actualMetaType ==
MetaType
.MetaXml) {
2728
metaType =
MetaType
.MetaNText;
2730
else if (actualMetaType ==
MetaType
.MetaMaxVarBinary) {
2731
metaType =
MetaType
.MetaImage;
2733
else if (actualMetaType ==
MetaType
.MetaMaxVarChar) {
2734
metaType =
MetaType
.MetaText;
2736
else if (actualMetaType ==
MetaType
.MetaMaxNVarChar) {
2737
metaType =
MetaType
.MetaNText;
3588
var
metaType = _metaData[currentColumn].metaType;
fx\src\data\System\Data\SqlClient\SqlDataReaderSmi.cs (6)
80
return
MetaType
.GetMetaTypeFromSqlDbType(
92
return
MetaType
.GetMetaTypeFromSqlDbType(
554
MetaType
metaType =
MetaType
.GetMetaTypeFromSqlDbType(colMetaData.SqlDbType, colMetaData.IsMultiValued);
556
metaType =
MetaType
.GetMaxMetaTypeFromMetaType( metaType );
635
schemaRow[Scale] =
MetaType
.GetMetaTypeFromSqlDbType(
fx\src\data\System\Data\SqlClient\SqlEnums.cs (47)
173
internal static
MetaType
GetMetaTypeFromSqlDbType(SqlDbType target, bool isMultiValued) { // WebData 113289
220
internal static
MetaType
GetMetaTypeFromDbType(DbType target) {
254
internal static
MetaType
GetMaxMetaTypeFromMetaType(
MetaType
mt) {
277
static internal
MetaType
GetMetaTypeFromType(Type dataType) {
280
static internal
MetaType
GetMetaTypeFromValue(object value, bool streamAllowed=true) {
284
static private
MetaType
GetMetaTypeFromValue(Type dataType, object value, bool inferLen, bool streamAllowed) {
415
internal static
MetaType
PromoteStringType(string s) {
637
internal static
MetaType
GetSqlDataType(int tdsType, UInt32 userType, int length) {
696
internal static
MetaType
GetDefaultMetaType() {
706
private static readonly
MetaType
MetaBigInt = new MetaType
709
private static readonly
MetaType
MetaFloat = new MetaType
712
private static readonly
MetaType
MetaReal = new MetaType
717
private static readonly
MetaType
MetaBinary = new MetaType
721
private static readonly
MetaType
MetaTimestamp = new MetaType
724
internal static readonly
MetaType
MetaVarBinary = new MetaType
727
internal static readonly
MetaType
MetaMaxVarBinary = new MetaType
733
private static readonly
MetaType
MetaSmallVarBinary = new MetaType
736
internal static readonly
MetaType
MetaImage = new MetaType
739
private static readonly
MetaType
MetaBit = new MetaType
742
private static readonly
MetaType
MetaTinyInt = new MetaType
745
private static readonly
MetaType
MetaSmallInt = new MetaType
748
private static readonly
MetaType
MetaInt = new MetaType
754
private static readonly
MetaType
MetaChar = new MetaType
757
private static readonly
MetaType
MetaVarChar = new MetaType
760
internal static readonly
MetaType
MetaMaxVarChar = new MetaType
763
internal static readonly
MetaType
MetaText = new MetaType
769
private static readonly
MetaType
MetaNChar = new MetaType
772
internal static readonly
MetaType
MetaNVarChar = new MetaType
775
internal static readonly
MetaType
MetaMaxNVarChar = new MetaType
778
internal static readonly
MetaType
MetaNText = new MetaType
784
internal static readonly
MetaType
MetaDecimal = new MetaType
787
internal static readonly
MetaType
MetaXml = new MetaType
790
private static readonly
MetaType
MetaDateTime = new MetaType
793
private static readonly
MetaType
MetaSmallDateTime = new MetaType
796
private static readonly
MetaType
MetaMoney = new MetaType
799
private static readonly
MetaType
MetaSmallMoney = new MetaType
802
private static readonly
MetaType
MetaUniqueId = new MetaType
805
private static readonly
MetaType
MetaVariant = new MetaType
808
internal static readonly
MetaType
MetaUdt = new MetaType
811
private static readonly
MetaType
MetaMaxUdt = new MetaType
814
private static readonly
MetaType
MetaTable = new MetaType
819
private static readonly
MetaType
MetaSUDT = new MetaType
822
private static readonly
MetaType
MetaDate = new MetaType
825
internal static readonly
MetaType
MetaTime = new MetaType
828
private static readonly
MetaType
MetaDateTime2 = new MetaType
831
internal static readonly
MetaType
MetaDateTimeOffset = new MetaType
fx\src\data\System\Data\SqlClient\SqlParameter.cs (34)
61
private
MetaType
_metaType;
78
private
MetaType
_internalMetaType;
288
MetaType
metatype = _metaType;
295
_metaType =
MetaType
.GetMetaTypeFromDbType(value);
304
internal
MetaType
InternalMetaType {
338
MetaType
mt = GetMetaTypeOnly();
379
MetaType
mt = ValidateTypeLengths( true /* Yukon or newer */ );
638
MetaType
metatype = _metaType;
651
_metaType =
MetaType
.GetMetaTypeFromSqlDbType(value, value == SqlDbType.Structured);
679
return
MetaType
.GetNullSqlValue(GetMetaTypeOnly().SqlType);
695
return (
MetaType
.GetSqlValueFromComVariant(_value));
790
MetaType
mt = InternalMetaType;
805
mt =
MetaType
.GetMetaTypeFromValue(val, streamAllowed: false);
806
actualType =
MetaType
.GetSqlDataType(mt.TDSType, 0 /*no user type*/, 0 /*non-nullable type*/).SqlDbType;
868
_actualSize = (isSqlVariant ? 5 :
MetaType
.GetTimeSizeFromScale(GetActualScale()));
872
_actualSize = 3 + (isSqlVariant ? 5 :
MetaType
.GetTimeSizeFromScale(GetActualScale()));
876
_actualSize = 5 + (isSqlVariant ? 5 :
MetaType
.GetTimeSizeFromScale(GetActualScale()));
897
internal static object CoerceValue(object value,
MetaType
destinationType, out bool coercedToDataFeed, out bool typeChanged, bool allowStreaming = true) {
915
value =
MetaType
.GetStringFromXml((XmlReader)(((SqlXml)value).CreateReader()));
926
value =
MetaType
.GetStringFromXml((XmlReader)value);
1035
CoercedValue =
MetaType
.GetStringFromXml(((XmlDataFeed)value)._source);
1404
MetaType
metaType = _metaType;
1406
metaType =
MetaType
.GetDefaultMetaType();
1413
private
MetaType
GetMetaTypeOnly() {
1429
return
MetaType
.GetMetaTypeFromType(valueType);
1434
return
MetaType
.GetMetaTypeFromType(valueType);
1437
return
MetaType
.GetDefaultMetaType();
1477
MetaType
metaType = GetMetaTypeOnly();
1530
internal
MetaType
ValidateTypeLengths(bool yukonOrNewer) {
1531
MetaType
mt = InternalMetaType;
1574
mt =
MetaType
.GetMaxMetaTypeFromMetaType(mt);
1592
mt =
MetaType
.GetMetaTypeFromSqlDbType (SqlDbType.Image, false);
1598
mt =
MetaType
.GetMetaTypeFromSqlDbType (SqlDbType.Text, false);
1604
mt =
MetaType
.GetMetaTypeFromSqlDbType (SqlDbType.NText, false);
fx\src\data\System\Data\SqlClient\SqlUtil.cs (1)
778
static internal Exception BulkLoadCannotConvertValue(Type sourcetype,
MetaType
metatype, Exception e) {
fx\src\data\System\Data\SqlClient\TdsParser.cs (40)
3431
rec.metaType =
MetaType
.GetSqlDataType(tdsType, userType, tdsLen);
3441
rec.metaType =
MetaType
.GetMaxMetaTypeFromMetaType(rec.metaType);
4158
col.metaType =
MetaType
.GetSqlDataType(tdsType, userType, col.length);
4181
col.metaType =
MetaType
.GetMaxMetaTypeFromMetaType(col.metaType);
4244
col.length =
MetaType
.GetTimeSizeFromScale(col.scale);
4248
col.length = 3 +
MetaType
.GetTimeSizeFromScale(col.scale);
4252
col.length = 5 +
MetaType
.GetTimeSizeFromScale(col.scale);
4961
private bool IsNull(
MetaType
mt, ulong length) {
5280
MetaType
metaType = md.baseTI.metaType;
5284
metaType =
MetaType
.GetSqlDataType(tdsType, userType:0, length:length);
5666
MetaType
mt =
MetaType
.GetSqlDataType(type, 0 /*no user datatype*/, 0 /* no lenData, non-nullable type */);
5826
MetaType
mt =
MetaType
.GetMetaTypeFromValue(value);
5835
mt =
MetaType
.GetMetaTypeFromValue(new SqlMoney((decimal)value));
5928
TdsDateTime dt =
MetaType
.FromDateTime((DateTime)value, 8);
5989
MetaType
metatype =
MetaType
.GetMetaTypeFromValue(value);
6087
TdsDateTime dt =
MetaType
.FromDateTime((DateTime)value, 8);
8154
MetaType
mt = param.InternalMetaType;
8287
mt =
MetaType
.MetaMaxVarBinary;
8318
WriteSqlVariantValue(isSqlVal ?
MetaType
.GetComValueFromSqlVariant(value) : value, param.GetActualSize(), param.Offset, stateObj);
8767
MetaType
mt =
MetaType
.GetMetaTypeFromSqlDbType(metaData.SqlDbType, metaData.IsMultiValued);
8876
stateObj.WriteByte(checked((byte)
MetaType
.MetaDecimal.FixedLength)); // SmiMetaData's length and actual wire format's length are different
9513
MetaType
metatype = metadata.metaType;
9568
value =
MetaType
.GetStringFromXml((XmlReader)value);
9899
private bool IsBOMNeeded(
MetaType
type, object value) {
9924
private Task GetTerminationTask(Task unterminatedWriteTask, object value,
MetaType
type, int actualLength, TdsParserStateObject stateObj, bool isDataFeed) {
9942
private Task WriteSqlValue(object value,
MetaType
type, int actualLength, int codePageByteSize, int offset, TdsParserStateObject stateObj) {
9950
private Task WriteUnterminatedSqlValue(object value,
MetaType
type, int actualLength, int codePageByteSize, int offset, TdsParserStateObject stateObj) {
10505
private Task WriteValue(object value,
MetaType
type, byte scale, int actualLength, int encodingByteSize, int offset, TdsParserStateObject stateObj, int paramSize, bool isDataFeed) {
10512
private Task WriteUnterminatedValue(object value,
MetaType
type, byte scale, int actualLength, int encodingByteSize, int offset, TdsParserStateObject stateObj, int paramSize, bool isDataFeed)
10655
TdsDateTime dt =
MetaType
.FromDateTime((DateTime)value, (byte)type.FixedLength);
10659
throw SQL.SmallDateTimeOverflow(
MetaType
.ToDateTime(dt.days, dt.time, 4).ToString(CultureInfo.InvariantCulture));
10746
private byte[] SerializeUnencryptedValue(object value,
MetaType
type, byte scale, int actualLength, int offset, bool isDataFeed, byte normalizationVersion, TdsParserStateObject stateObj) {
10842
TdsDateTime dt =
MetaType
.FromDateTime((DateTime)value, (byte)type.FixedLength);
10846
throw SQL.SmallDateTimeOverflow(
MetaType
.ToDateTime(dt.days, dt.time, 4).ToString(CultureInfo.InvariantCulture));
10915
private byte[] SerializeUnencryptedSqlValue(object value,
MetaType
type, int actualLength, int offset, byte normalizationVersion, TdsParserStateObject stateObj) {
11066
internal void WriteParameterVarLen(
MetaType
type, int size, bool isNull, TdsParserStateObject stateObj, bool unknownLength=false) {
fx\src\data\System\Data\SqlClient\TdsParserHelperClasses.cs (1)
844
internal
MetaType
metaType; // cached metaType
fx\src\data\System\Data\SqlClient\TdsValueSetter.cs (9)
179
Debug.Assert(!
MetaType
.GetMetaTypeFromSqlDbType(_metaData.SqlDbType, _metaData.IsMultiValued).IsLong,
203
Debug.Assert(!
MetaType
.GetMetaTypeFromSqlDbType(_metaData.SqlDbType, _metaData.IsMultiValued).IsLong,
266
Debug.Assert(!
MetaType
.GetMetaTypeFromSqlDbType(_metaData.SqlDbType, _metaData.IsMultiValued).IsLong,
292
Debug.Assert(!
MetaType
.GetMetaTypeFromSqlDbType(_metaData.SqlDbType, _metaData.IsMultiValued).IsLong,
472
_stateObj.WriteByte(checked((byte)
MetaType
.MetaDecimal.FixedLength)); // SmiMetaData's length and actual wire format's length are different
492
TdsDateTime dt =
MetaType
.FromDateTime(value, 8);
506
TdsDateTime dt =
MetaType
.FromDateTime(value, (byte)_metaData.MaxLength);
512
TdsDateTime dt =
MetaType
.FromDateTime(value, (byte)_metaData.MaxLength);
575
scale =
MetaType
.MetaDateTimeOffset.Scale;