128 references to DbType
Microsoft.ML.Data (55)
DataLoadSave\Database\DatabaseLoader.cs (11)
190/// <param name="dbType"><see cref="DbType"/> of the items in the column.</param> 192public Column(string name, DbType dbType, int index) 201/// <param name="dbType"><see cref="DbType"/> of the items in the column.</param> 204public Column(string name, DbType dbType, int minIndex, int maxIndex) 213/// <param name="dbType"><see cref="DbType"/> of the items in the column.</param> 216public Column(string name, DbType dbType, Range[] source, KeyCount keyCount = null) 234/// <see cref="DbType"/> of the items in the column. 237public DbType Type = DbType.Single; 499ch.CheckUserArg(Enum.IsDefined(typeof(DbType), col.Type), nameof(Column.Type), "Bad item type"); 683private static KeyDataViewType ConstructKeyType(DbType dbType, KeyCount keyCount)
DataLoadSave\Database\DbExtensions.cs (44)
13/// Maps a <see cref="DbType"/> to the associated .Net representation type. 15public static Type ToType(this DbType dbType) 19case DbType.AnsiString: 20case DbType.AnsiStringFixedLength: 21case DbType.String: 22case DbType.StringFixedLength: 24case DbType.Binary: 26case DbType.Boolean: 28case DbType.Byte: 30case DbType.Date: 31case DbType.DateTime: 32case DbType.DateTime2: 34case DbType.DateTimeOffset: 36case DbType.Decimal: 38case DbType.Double: 40case DbType.Guid: 42case DbType.Int16: 44case DbType.Int32: 46case DbType.Int64: 48case DbType.Object: 50case DbType.SByte: 52case DbType.Single: 54case DbType.Time: 56case DbType.UInt16: 58case DbType.UInt32: 60case DbType.UInt64: 62case DbType.Currency: 63case DbType.VarNumeric: 64case DbType.Xml: 70/// <summary>Maps a <see cref="InternalDataKind"/> to the associated <see cref="DbType"/>.</summary> 71public static DbType ToDbType(this InternalDataKind dataKind) 77return DbType.SByte; 82return DbType.Byte; 87return DbType.Int16; 92return DbType.UInt16; 97return DbType.Int32; 102return DbType.UInt32; 107return DbType.Int64; 112return DbType.UInt64; 117return DbType.Single; 122return DbType.Double; 127return DbType.String; 132return DbType.Boolean; 137return DbType.DateTime;
Microsoft.ML.Tests (6)
DatabaseLoaderTests.cs (6)
56new DatabaseLoader.Column() { Name = "Label", Type = DbType.Int32 }, 57new DatabaseLoader.Column() { Name = "SepalLength", Type = DbType.Single }, 58new DatabaseLoader.Column() { Name = "SepalWidth", Type = DbType.Single }, 59new DatabaseLoader.Column() { Name = "PetalLength", Type = DbType.Single }, 60new DatabaseLoader.Column() { Name = "PetalWidth", Type = DbType.Single } 258var loader = mlContext.Data.CreateDatabaseLoader(new DatabaseLoader.Column("datetime", DbType.DateTime, 0));
netstandard (1)
netstandard.cs (1)
523[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.DbType))]
System.Data (1)
src\libraries\shims\System.Data\ref\System.Data.cs (1)
92[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.DbType))]
System.Data.Common (4)
System\Data\Common\DBCommandBuilder.cs (1)
1153p.DbType = DbType.Int32;
System\Data\Common\DbDataAdapter.cs (1)
775Debug.Assert(DbType.Int32 == parameter.DbType, "unexpected DbType");
System\Data\Common\DbParameter.cs (1)
16public abstract DbType DbType { get; set; }
System\Data\IDataParameter.cs (1)
10DbType DbType { get; set; }
System.Data.Odbc (60)
Common\System\Data\Common\AdapterUtil.Odbc.cs (1)
372internal static ArgumentException DbTypeNotSupported(System.Data.DbType type, Type enumtype)
System\Data\Odbc\Odbc32.cs (58)
766private static readonly TypeMap s_bigInt = new TypeMap(OdbcType.BigInt, DbType.Int64, typeof(long), ODBC32.SQL_TYPE.BIGINT, ODBC32.SQL_C.SBIGINT, ODBC32.SQL_C.SBIGINT, 8, 20, true); 767private static readonly TypeMap s_binary = new TypeMap(OdbcType.Binary, DbType.Binary, typeof(byte[]), ODBC32.SQL_TYPE.BINARY, ODBC32.SQL_C.BINARY, ODBC32.SQL_C.BINARY, -1, -1, false); 768private static readonly TypeMap s_bit = new TypeMap(OdbcType.Bit, DbType.Boolean, typeof(bool), ODBC32.SQL_TYPE.BIT, ODBC32.SQL_C.BIT, ODBC32.SQL_C.BIT, 1, 1, false); 769internal static readonly TypeMap _Char = new TypeMap(OdbcType.Char, DbType.AnsiStringFixedLength, typeof(string), ODBC32.SQL_TYPE.CHAR, ODBC32.SQL_C.WCHAR, ODBC32.SQL_C.CHAR, -1, -1, false); 770private static readonly TypeMap s_dateTime = new TypeMap(OdbcType.DateTime, DbType.DateTime, typeof(DateTime), ODBC32.SQL_TYPE.TYPE_TIMESTAMP, ODBC32.SQL_C.TYPE_TIMESTAMP, ODBC32.SQL_C.TYPE_TIMESTAMP, 16, 23, false); 771private static readonly TypeMap s_date = new TypeMap(OdbcType.Date, DbType.Date, typeof(DateTime), ODBC32.SQL_TYPE.TYPE_DATE, ODBC32.SQL_C.TYPE_DATE, ODBC32.SQL_C.TYPE_DATE, 6, 10, false); 772private static readonly TypeMap s_time = new TypeMap(OdbcType.Time, DbType.Time, typeof(TimeSpan), ODBC32.SQL_TYPE.TYPE_TIME, ODBC32.SQL_C.TYPE_TIME, ODBC32.SQL_C.TYPE_TIME, 6, 12, false); 773private static readonly TypeMap s_decimal = new TypeMap(OdbcType.Decimal, DbType.Decimal, typeof(decimal), ODBC32.SQL_TYPE.DECIMAL, ODBC32.SQL_C.NUMERIC, ODBC32.SQL_C.NUMERIC, 19, ADP.DecimalMaxPrecision28, false); 775private static readonly TypeMap s_double = new TypeMap(OdbcType.Double, DbType.Double, typeof(double), ODBC32.SQL_TYPE.DOUBLE, ODBC32.SQL_C.DOUBLE, ODBC32.SQL_C.DOUBLE, 8, 15, false); 776internal static readonly TypeMap _Image = new TypeMap(OdbcType.Image, DbType.Binary, typeof(byte[]), ODBC32.SQL_TYPE.LONGVARBINARY, ODBC32.SQL_C.BINARY, ODBC32.SQL_C.BINARY, -1, -1, false); 777private static readonly TypeMap s_int = new TypeMap(OdbcType.Int, DbType.Int32, typeof(int), ODBC32.SQL_TYPE.INTEGER, ODBC32.SQL_C.SLONG, ODBC32.SQL_C.SLONG, 4, 10, true); 778private static readonly TypeMap s_NChar = new TypeMap(OdbcType.NChar, DbType.StringFixedLength, typeof(string), ODBC32.SQL_TYPE.WCHAR, ODBC32.SQL_C.WCHAR, ODBC32.SQL_C.WCHAR, -1, -1, false); 779internal static readonly TypeMap _NText = new TypeMap(OdbcType.NText, DbType.String, typeof(string), ODBC32.SQL_TYPE.WLONGVARCHAR, ODBC32.SQL_C.WCHAR, ODBC32.SQL_C.WCHAR, -1, -1, false); 780private static readonly TypeMap s_numeric = new TypeMap(OdbcType.Numeric, DbType.Decimal, typeof(decimal), ODBC32.SQL_TYPE.NUMERIC, ODBC32.SQL_C.NUMERIC, ODBC32.SQL_C.NUMERIC, 19, ADP.DecimalMaxPrecision28, false); 781internal static readonly TypeMap _NVarChar = new TypeMap(OdbcType.NVarChar, DbType.String, typeof(string), ODBC32.SQL_TYPE.WVARCHAR, ODBC32.SQL_C.WCHAR, ODBC32.SQL_C.WCHAR, -1, -1, false); 782private static readonly TypeMap s_real = new TypeMap(OdbcType.Real, DbType.Single, typeof(float), ODBC32.SQL_TYPE.REAL, ODBC32.SQL_C.REAL, ODBC32.SQL_C.REAL, 4, 7, false); 783private static readonly TypeMap s_uniqueId = new TypeMap(OdbcType.UniqueIdentifier, DbType.Guid, typeof(Guid), ODBC32.SQL_TYPE.GUID, ODBC32.SQL_C.GUID, ODBC32.SQL_C.GUID, 16, 36, false); 784private static readonly TypeMap s_smallDT = new TypeMap(OdbcType.SmallDateTime, DbType.DateTime, typeof(DateTime), ODBC32.SQL_TYPE.TYPE_TIMESTAMP, ODBC32.SQL_C.TYPE_TIMESTAMP, ODBC32.SQL_C.TYPE_TIMESTAMP, 16, 23, false); 785private static readonly TypeMap s_smallInt = new TypeMap(OdbcType.SmallInt, DbType.Int16, typeof(short), ODBC32.SQL_TYPE.SMALLINT, ODBC32.SQL_C.SSHORT, ODBC32.SQL_C.SSHORT, 2, 5, true); 786internal static readonly TypeMap _Text = new TypeMap(OdbcType.Text, DbType.AnsiString, typeof(string), ODBC32.SQL_TYPE.LONGVARCHAR, ODBC32.SQL_C.WCHAR, ODBC32.SQL_C.CHAR, -1, -1, false); 787private static readonly TypeMap s_timestamp = new TypeMap(OdbcType.Timestamp, DbType.Binary, typeof(byte[]), ODBC32.SQL_TYPE.BINARY, ODBC32.SQL_C.BINARY, ODBC32.SQL_C.BINARY, -1, -1, false); 788private static readonly TypeMap s_tinyInt = new TypeMap(OdbcType.TinyInt, DbType.Byte, typeof(byte), ODBC32.SQL_TYPE.TINYINT, ODBC32.SQL_C.UTINYINT, ODBC32.SQL_C.UTINYINT, 1, 3, true); 789private static readonly TypeMap s_varBinary = new TypeMap(OdbcType.VarBinary, DbType.Binary, typeof(byte[]), ODBC32.SQL_TYPE.VARBINARY, ODBC32.SQL_C.BINARY, ODBC32.SQL_C.BINARY, -1, -1, false); 790internal static readonly TypeMap _VarChar = new TypeMap(OdbcType.VarChar, DbType.AnsiString, typeof(string), ODBC32.SQL_TYPE.VARCHAR, ODBC32.SQL_C.WCHAR, ODBC32.SQL_C.CHAR, -1, -1, false); 791private static readonly TypeMap s_variant = new TypeMap(OdbcType.Binary, DbType.Binary, typeof(object), ODBC32.SQL_TYPE.SS_VARIANT, ODBC32.SQL_C.BINARY, ODBC32.SQL_C.BINARY, -1, -1, false); 792private static readonly TypeMap s_UDT = new TypeMap(OdbcType.Binary, DbType.Binary, typeof(object), ODBC32.SQL_TYPE.SS_UDT, ODBC32.SQL_C.BINARY, ODBC32.SQL_C.BINARY, -1, -1, false); 793private static readonly TypeMap s_XML = new TypeMap(OdbcType.Text, DbType.AnsiString, typeof(string), ODBC32.SQL_TYPE.LONGVARCHAR, ODBC32.SQL_C.WCHAR, ODBC32.SQL_C.CHAR, -1, -1, false); 796internal readonly DbType _dbType; 808private TypeMap(OdbcType odbcType, DbType dbType, Type type, ODBC32.SQL_TYPE sql_type, ODBC32.SQL_C sql_c, ODBC32.SQL_C param_sql_c, int bsize, int csize, bool signType) 853internal static TypeMap FromDbType(DbType dbType) 857case DbType.AnsiString: return _VarChar; 858case DbType.AnsiStringFixedLength: return _Char; 859case DbType.Binary: return s_varBinary; 860case DbType.Byte: return s_tinyInt; 861case DbType.Boolean: return s_bit; 862case DbType.Currency: return s_decimal; 864case DbType.Date: return s_date; 865case DbType.Time: return s_time; 866case DbType.DateTime: return s_dateTime; 867case DbType.Decimal: return s_decimal; 868case DbType.Double: return s_double; 869case DbType.Guid: return s_uniqueId; 870case DbType.Int16: return s_smallInt; 871case DbType.Int32: return s_int; 872case DbType.Int64: return s_bigInt; 873case DbType.Single: return s_real; 874case DbType.String: return _NVarChar; 875case DbType.StringFixedLength: return s_NChar; 876case DbType.Object: 877case DbType.SByte: 878case DbType.UInt16: 879case DbType.UInt32: 880case DbType.UInt64: 881case DbType.VarNumeric: 986DbType.Int64 => s_decimal, // upgrade to decimal 987DbType.Int32 => s_bigInt, // upgrade to 64 bit 988DbType.Int16 => s_int, // upgrade to 32 bit 996DbType.Byte => s_smallInt, // upgrade to 16 bit
System\Data\Odbc\OdbcParameter.cs (1)
149public override System.Data.DbType DbType
System.Data.OleDb (1)
artifacts\obj\System.Data.OleDb\Debug\net10.0\System.Data.OleDb.notsupported.cs (1)
353public override System.Data.DbType DbType { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_OleDb); } set { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_OleDb); } }