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