166 references to SQL_TYPE
System.Data.Odbc (166)
System\Data\Odbc\DbDataRecord.cs (1)
15internal ODBC32.SQL_TYPE? _dbtype;
System\Data\Odbc\Odbc32.cs (60)
23internal static Exception UnknownSQLType(ODBC32.SQL_TYPE sqltype) 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); 799internal readonly ODBC32.SQL_TYPE _sql_type; 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) 935internal static TypeMap FromSqlType(ODBC32.SQL_TYPE sqltype) 939case ODBC32.SQL_TYPE.CHAR: return _Char; 940case ODBC32.SQL_TYPE.VARCHAR: return _VarChar; 941case ODBC32.SQL_TYPE.LONGVARCHAR: return _Text; 942case ODBC32.SQL_TYPE.WCHAR: return s_NChar; 943case ODBC32.SQL_TYPE.WVARCHAR: return _NVarChar; 944case ODBC32.SQL_TYPE.WLONGVARCHAR: return _NText; 945case ODBC32.SQL_TYPE.DECIMAL: return s_decimal; 946case ODBC32.SQL_TYPE.NUMERIC: return s_numeric; 947case ODBC32.SQL_TYPE.SMALLINT: return s_smallInt; 948case ODBC32.SQL_TYPE.INTEGER: return s_int; 949case ODBC32.SQL_TYPE.REAL: return s_real; 950case ODBC32.SQL_TYPE.FLOAT: return s_double; 951case ODBC32.SQL_TYPE.DOUBLE: return s_double; 952case ODBC32.SQL_TYPE.BIT: return s_bit; 953case ODBC32.SQL_TYPE.TINYINT: return s_tinyInt; 954case ODBC32.SQL_TYPE.BIGINT: return s_bigInt; 955case ODBC32.SQL_TYPE.BINARY: return s_binary; 956case ODBC32.SQL_TYPE.VARBINARY: return s_varBinary; 957case ODBC32.SQL_TYPE.LONGVARBINARY: return _Image; 958case ODBC32.SQL_TYPE.TYPE_DATE: return s_date; 959case ODBC32.SQL_TYPE.TYPE_TIME: return s_time; 960case ODBC32.SQL_TYPE.TIMESTAMP: 961case ODBC32.SQL_TYPE.TYPE_TIMESTAMP: return s_dateTime; 962case ODBC32.SQL_TYPE.GUID: return s_uniqueId; 963case ODBC32.SQL_TYPE.SS_VARIANT: return s_variant; 964case ODBC32.SQL_TYPE.SS_UDT: return s_UDT; 965case ODBC32.SQL_TYPE.SS_XML: return s_XML; 967case ODBC32.SQL_TYPE.SS_UTCDATETIME: 968case ODBC32.SQL_TYPE.SS_TIME_EX:
System\Data\Odbc\OdbcCommandBuilder.cs (1)
232parameter.OdbcType = TypeMap.FromSqlType((ODBC32.SQL_TYPE)reader.GetInt16(ODBC32.DATA_TYPE - 1))._odbcType;
System\Data\Odbc\OdbcConnection.cs (16)
656internal void SetSupportedType(ODBC32.SQL_TYPE sqltype) 662case ODBC32.SQL_TYPE.NUMERIC: 667case ODBC32.SQL_TYPE.WCHAR: 672case ODBC32.SQL_TYPE.WVARCHAR: 677case ODBC32.SQL_TYPE.WLONGVARCHAR: 690internal void FlagRestrictedSqlBindType(ODBC32.SQL_TYPE sqltype) 696case ODBC32.SQL_TYPE.NUMERIC: 701case ODBC32.SQL_TYPE.DECIMAL: 805internal bool TestTypeSupport(ODBC32.SQL_TYPE sqltype) 814case ODBC32.SQL_TYPE.NUMERIC: 820case ODBC32.SQL_TYPE.WCHAR: 826case ODBC32.SQL_TYPE.WVARCHAR: 832case ODBC32.SQL_TYPE.WLONGVARCHAR: 860internal bool TestRestrictedSqlBindType(ODBC32.SQL_TYPE sqltype) 865case ODBC32.SQL_TYPE.NUMERIC: 870case ODBC32.SQL_TYPE.DECIMAL:
System\Data\Odbc\OdbcDataReader.cs (34)
470case ODBC32.SQL_TYPE.CHAR: 471case ODBC32.SQL_TYPE.VARCHAR: 472case ODBC32.SQL_TYPE.LONGVARCHAR: 473case ODBC32.SQL_TYPE.WCHAR: 474case ODBC32.SQL_TYPE.WVARCHAR: 475case ODBC32.SQL_TYPE.WLONGVARCHAR: 478case ODBC32.SQL_TYPE.DECIMAL: 479case ODBC32.SQL_TYPE.NUMERIC: 482case ODBC32.SQL_TYPE.SMALLINT: 485case ODBC32.SQL_TYPE.INTEGER: 488case ODBC32.SQL_TYPE.REAL: 491case ODBC32.SQL_TYPE.FLOAT: 492case ODBC32.SQL_TYPE.DOUBLE: 495case ODBC32.SQL_TYPE.BIT: 498case ODBC32.SQL_TYPE.TINYINT: 501case ODBC32.SQL_TYPE.BIGINT: 504case ODBC32.SQL_TYPE.BINARY: 505case ODBC32.SQL_TYPE.VARBINARY: 506case ODBC32.SQL_TYPE.LONGVARBINARY: 509case ODBC32.SQL_TYPE.TYPE_DATE: 512case ODBC32.SQL_TYPE.TYPE_TIME: 516case ODBC32.SQL_TYPE.TYPE_TIMESTAMP: 519case ODBC32.SQL_TYPE.GUID: 522case ODBC32.SQL_TYPE.SS_VARIANT: 538ODBC32.SQL_TYPE subtype = (ODBC32.SQL_TYPE)(int)GetColAttribute(i, (ODBC32.SQL_DESC)ODBC32.SQL_CA_SS.VARIANT_SQL_TYPE, (ODBC32.SQL_COLUMN)(-1), ODBC32.HANDLER.THROW); 589info._dbtype = unchecked((ODBC32.SQL_TYPE)(int)GetColAttribute(i, ODBC32.SQL_DESC.CONCISE_TYPE, ODBC32.SQL_COLUMN.TYPE, ODBC32.HANDLER.THROW)); 2026typeMap = TypeMap.FromSqlType((ODBC32.SQL_TYPE)unchecked((int)GetColAttribute(i, ODBC32.SQL_DESC.CONCISE_TYPE, ODBC32.SQL_COLUMN.TYPE, ODBC32.HANDLER.THROW))); 2041case ODBC32.SQL_TYPE.WCHAR: 2042case ODBC32.SQL_TYPE.WLONGVARCHAR: 2043case ODBC32.SQL_TYPE.WVARCHAR: 2059case ODBC32.SQL_TYPE.LONGVARCHAR: 2060case ODBC32.SQL_TYPE.WLONGVARCHAR: 2061case ODBC32.SQL_TYPE.LONGVARBINARY:
System\Data\Odbc\OdbcMetaDataFactory.cs (33)
246ODBC32.SQL_TYPE sqlType; 251sqlType = (ODBC32.SQL_TYPE)(int)Convert.ChangeType(getTypeInfoValues[indexDATA_TYPE], typeof(int), null); 258sqlType = ODBC32.SQL_TYPE.TYPE_DATE; 262sqlType = ODBC32.SQL_TYPE.TYPE_TIME; 288case ODBC32.SQL_TYPE.LONGVARCHAR: 289case ODBC32.SQL_TYPE.WLONGVARCHAR: 290case ODBC32.SQL_TYPE.LONGVARBINARY: 291case ODBC32.SQL_TYPE.SS_XML: 296case ODBC32.SQL_TYPE.VARCHAR: 297case ODBC32.SQL_TYPE.WVARCHAR: 298case ODBC32.SQL_TYPE.VARBINARY: 303case ODBC32.SQL_TYPE.CHAR: 304case ODBC32.SQL_TYPE.WCHAR: 305case ODBC32.SQL_TYPE.DECIMAL: 306case ODBC32.SQL_TYPE.NUMERIC: 307case ODBC32.SQL_TYPE.SMALLINT: 308case ODBC32.SQL_TYPE.INTEGER: 309case ODBC32.SQL_TYPE.REAL: 310case ODBC32.SQL_TYPE.FLOAT: 311case ODBC32.SQL_TYPE.DOUBLE: 312case ODBC32.SQL_TYPE.BIT: 313case ODBC32.SQL_TYPE.TINYINT: 314case ODBC32.SQL_TYPE.BIGINT: 315case ODBC32.SQL_TYPE.TYPE_DATE: 316case ODBC32.SQL_TYPE.TYPE_TIME: 317case ODBC32.SQL_TYPE.TIMESTAMP: 318case ODBC32.SQL_TYPE.TYPE_TIMESTAMP: 319case ODBC32.SQL_TYPE.GUID: 320case ODBC32.SQL_TYPE.SS_VARIANT: 321case ODBC32.SQL_TYPE.SS_UTCDATETIME: 322case ODBC32.SQL_TYPE.SS_TIME_EX: 323case ODBC32.SQL_TYPE.BINARY: 328case ODBC32.SQL_TYPE.SS_UDT:
System\Data\Odbc\OdbcParameter.cs (20)
46private ODBC32.SQL_TYPE _boundParameterType; // if we bound already that is the type we used 366if ((ODBC32.SQL_TYPE.CHAR == _bindtype._sql_type) 367|| (ODBC32.SQL_TYPE.VARCHAR == _bindtype._sql_type) 368|| (ODBC32.SQL_TYPE.LONGVARCHAR == _bindtype._sql_type)) 380if ((ODBC32.SQL_TYPE.CHAR == _bindtype._sql_type) 381|| (ODBC32.SQL_TYPE.VARCHAR == _bindtype._sql_type) 382|| (ODBC32.SQL_TYPE.LONGVARCHAR == _bindtype._sql_type)) 671case ODBC32.SQL_TYPE.DECIMAL: 672case ODBC32.SQL_TYPE.NUMERIC: 675|| !command.Connection.TestTypeSupport(ODBC32.SQL_TYPE.NUMERIC) // otherwise we convert if the driver does not support numeric 690case ODBC32.SQL_TYPE.BIGINT: 704case ODBC32.SQL_TYPE.WCHAR: // MDAC 68993 705case ODBC32.SQL_TYPE.WVARCHAR: 706case ODBC32.SQL_TYPE.WLONGVARCHAR: 717if (ODBC32.SQL_TYPE.WCHAR == _bindtype._sql_type) { _bindtype = TypeMap._Char; } 718else if (ODBC32.SQL_TYPE.WVARCHAR == _bindtype._sql_type) { _bindtype = TypeMap._VarChar; } 719else if (ODBC32.SQL_TYPE.WLONGVARCHAR == _bindtype._sql_type) 757case ODBC32.SQL_TYPE.VARBINARY: 764case ODBC32.SQL_TYPE.VARCHAR: 771case ODBC32.SQL_TYPE.WVARCHAR:
System\Data\Odbc\OdbcStatementHandle.cs (1)
74internal ODBC32.SQLRETURN BindParameter(short ordinal, short parameterDirection, ODBC32.SQL_C sqlctype, ODBC32.SQL_TYPE sqltype, IntPtr cchSize, IntPtr scale, HandleRef buffer, IntPtr bufferLength, HandleRef intbuffer)