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>
192
public Column(string name,
DbType
dbType, int index)
201
/// <param name="dbType"><see cref="
DbType
"/> of the items in the column.</param>
204
public Column(string name,
DbType
dbType, int minIndex, int maxIndex)
213
/// <param name="dbType"><see cref="
DbType
"/> of the items in the column.</param>
216
public Column(string name,
DbType
dbType, Range[] source, KeyCount keyCount = null)
234
/// <see cref="
DbType
"/> of the items in the column.
237
public
DbType
Type =
DbType
.Single;
499
ch.CheckUserArg(Enum.IsDefined(typeof(
DbType
), col.Type), nameof(Column.Type), "Bad item type");
683
private static KeyDataViewType ConstructKeyType(
DbType
dbType, KeyCount keyCount)
DataLoadSave\Database\DbExtensions.cs (44)
13
/// Maps a <see cref="
DbType
"/> to the associated .Net representation type.
15
public static Type ToType(this
DbType
dbType)
19
case
DbType
.AnsiString:
20
case
DbType
.AnsiStringFixedLength:
21
case
DbType
.String:
22
case
DbType
.StringFixedLength:
24
case
DbType
.Binary:
26
case
DbType
.Boolean:
28
case
DbType
.Byte:
30
case
DbType
.Date:
31
case
DbType
.DateTime:
32
case
DbType
.DateTime2:
34
case
DbType
.DateTimeOffset:
36
case
DbType
.Decimal:
38
case
DbType
.Double:
40
case
DbType
.Guid:
42
case
DbType
.Int16:
44
case
DbType
.Int32:
46
case
DbType
.Int64:
48
case
DbType
.Object:
50
case
DbType
.SByte:
52
case
DbType
.Single:
54
case
DbType
.Time:
56
case
DbType
.UInt16:
58
case
DbType
.UInt32:
60
case
DbType
.UInt64:
62
case
DbType
.Currency:
63
case
DbType
.VarNumeric:
64
case
DbType
.Xml:
70
/// <summary>Maps a <see cref="InternalDataKind"/> to the associated <see cref="
DbType
"/>.</summary>
71
public static
DbType
ToDbType(this InternalDataKind dataKind)
77
return
DbType
.SByte;
82
return
DbType
.Byte;
87
return
DbType
.Int16;
92
return
DbType
.UInt16;
97
return
DbType
.Int32;
102
return
DbType
.UInt32;
107
return
DbType
.Int64;
112
return
DbType
.UInt64;
117
return
DbType
.Single;
122
return
DbType
.Double;
127
return
DbType
.String;
132
return
DbType
.Boolean;
137
return
DbType
.DateTime;
Microsoft.ML.Tests (6)
DatabaseLoaderTests.cs (6)
56
new DatabaseLoader.Column() { Name = "Label", Type =
DbType
.Int32 },
57
new DatabaseLoader.Column() { Name = "SepalLength", Type =
DbType
.Single },
58
new DatabaseLoader.Column() { Name = "SepalWidth", Type =
DbType
.Single },
59
new DatabaseLoader.Column() { Name = "PetalLength", Type =
DbType
.Single },
60
new DatabaseLoader.Column() { Name = "PetalWidth", Type =
DbType
.Single }
258
var 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)
1153
p.DbType =
DbType
.Int32;
System\Data\Common\DbDataAdapter.cs (1)
775
Debug.Assert(
DbType
.Int32 == parameter.DbType, "unexpected DbType");
System\Data\Common\DbParameter.cs (1)
16
public abstract
DbType
DbType { get; set; }
System\Data\IDataParameter.cs (1)
10
DbType
DbType { get; set; }
System.Data.Odbc (60)
Common\System\Data\Common\AdapterUtil.Odbc.cs (1)
372
internal static ArgumentException DbTypeNotSupported(System.Data.
DbType
type, Type enumtype)
System\Data\Odbc\Odbc32.cs (58)
766
private 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);
767
private 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);
768
private 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);
769
internal 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);
770
private 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);
771
private 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);
772
private 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);
773
private 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);
775
private 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);
776
internal 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);
777
private 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);
778
private 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);
779
internal 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);
780
private 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);
781
internal 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);
782
private 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);
783
private 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);
784
private 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);
785
private 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);
786
internal 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);
787
private 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);
788
private 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);
789
private 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);
790
internal 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);
791
private 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);
792
private 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);
793
private 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);
796
internal readonly
DbType
_dbType;
808
private 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)
853
internal static TypeMap FromDbType(
DbType
dbType)
857
case
DbType
.AnsiString: return _VarChar;
858
case
DbType
.AnsiStringFixedLength: return _Char;
859
case
DbType
.Binary: return s_varBinary;
860
case
DbType
.Byte: return s_tinyInt;
861
case
DbType
.Boolean: return s_bit;
862
case
DbType
.Currency: return s_decimal;
864
case
DbType
.Date: return s_date;
865
case
DbType
.Time: return s_time;
866
case
DbType
.DateTime: return s_dateTime;
867
case
DbType
.Decimal: return s_decimal;
868
case
DbType
.Double: return s_double;
869
case
DbType
.Guid: return s_uniqueId;
870
case
DbType
.Int16: return s_smallInt;
871
case
DbType
.Int32: return s_int;
872
case
DbType
.Int64: return s_bigInt;
873
case
DbType
.Single: return s_real;
874
case
DbType
.String: return _NVarChar;
875
case
DbType
.StringFixedLength: return s_NChar;
876
case
DbType
.Object:
877
case
DbType
.SByte:
878
case
DbType
.UInt16:
879
case
DbType
.UInt32:
880
case
DbType
.UInt64:
881
case
DbType
.VarNumeric:
986
DbType
.Int64 => s_decimal, // upgrade to decimal
987
DbType
.Int32 => s_bigInt, // upgrade to 64 bit
988
DbType
.Int16 => s_int, // upgrade to 32 bit
996
DbType
.Byte => s_smallInt, // upgrade to 16 bit
System\Data\Odbc\OdbcParameter.cs (1)
149
public override System.Data.
DbType
DbType
System.Data.OleDb (1)
artifacts\obj\System.Data.OleDb\Debug\net10.0\System.Data.OleDb.notsupported.cs (1)
353
public override System.Data.
DbType
DbType { get { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_OleDb); } set { throw new System.PlatformNotSupportedException(System.SR.PlatformNotSupported_OleDb); } }