179 references to SQL_C
System.Data.Odbc (179)
src\libraries\Common\src\Interop\Interop.Odbc.cs (4)
39/*SQLSMALLINT*/ODBC32.SQL_C TargetType, 52/*SQLSMALLINT*/ODBC32.SQL_C TargetType, 62/*SQLSMALLINT*/ODBC32.SQL_C SQLCType, 180/*SQLSMALLINT*/ODBC32.SQL_C TargetType,
System\Data\Odbc\Odbc32.cs (70)
539CHAR = SQL_C.CHAR, //SQL_CHAR 542WCHAR = SQL_C.WCHAR, //SQL_WCHAR 546NUMERIC = SQL_C.NUMERIC, //SQL_NUMERIC 549REAL = SQL_C.REAL, //SQL_REAL 551DOUBLE = SQL_C.DOUBLE, //SQL_DOUBLE 552BIT = SQL_C.BIT, //SQL_BIT 555BINARY = SQL_C.BINARY, //SQL_BINARY 560TYPE_DATE = SQL_C.TYPE_DATE, //SQL_TYPE_DATE 561TYPE_TIME = SQL_C.TYPE_TIME, //SQL_TYPE_TIME 562TIMESTAMP = SQL_C.TIMESTAMP, //SQL_TIMESTAMP 563TYPE_TIMESTAMP = SQL_C.TYPE_TIMESTAMP, //SQL_TYPE_TIMESTAMP 566GUID = SQL_C.GUID, //SQL_GUID 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); 800internal readonly ODBC32.SQL_C _sql_c; 801internal readonly ODBC32.SQL_C _param_sql_c; 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)
System\Data\Odbc\OdbcDataReader.cs (44)
533bool isNotDbNull = QueryFieldInfo(i, ODBC32.SQL_C.BINARY, out _); 672if (GetData(i, ODBC32.SQL_C.UTINYINT)) 692if (GetData(i, ODBC32.SQL_C.WCHAR)) 712if (GetData(i, ODBC32.SQL_C.SSHORT)) 732if (GetData(i, ODBC32.SQL_C.SLONG)) 759if (GetData(i, ODBC32.SQL_C.WCHAR)) 761string value = (string)Buffer.MarshalToManaged(0, ODBC32.SQL_C.WCHAR, ODBC32.SQL_NTS); 780if (GetData(i, ODBC32.SQL_C.BIT)) 782_dataCache[i] = Buffer.MarshalToManaged(0, ODBC32.SQL_C.BIT, -1); 800if (GetData(i, ODBC32.SQL_C.REAL)) 821if (GetData(i, ODBC32.SQL_C.TYPE_DATE)) 823_dataCache[i] = Buffer.MarshalToManaged(0, ODBC32.SQL_C.TYPE_DATE, -1); 842if (GetData(i, ODBC32.SQL_C.TYPE_TIMESTAMP)) 844_dataCache[i] = Buffer.MarshalToManaged(0, ODBC32.SQL_C.TYPE_TIMESTAMP, -1); 870if (GetData(i, ODBC32.SQL_C.WCHAR)) 875s = (string)Buffer.MarshalToManaged(0, ODBC32.SQL_C.WCHAR, ODBC32.SQL_NTS); 900if (GetData(i, ODBC32.SQL_C.DOUBLE)) 921if (GetData(i, ODBC32.SQL_C.GUID)) 961if (GetData(i, ODBC32.SQL_C.WCHAR, buffer.Length - 2, out lengthOrIndicator)) 1005gotData = GetData(i, ODBC32.SQL_C.WCHAR, buffer.Length - 2, out lengthOrIndicator); 1049if (GetData(i, ODBC32.SQL_C.TYPE_TIME)) 1051_dataCache[i] = Buffer.MarshalToManaged(0, ODBC32.SQL_C.TYPE_TIME, -1); 1211ODBC32.SQL_C sqlctype; 1215sqlctype = isCharsBuffer ? ODBC32.SQL_C.WCHAR : ODBC32.SQL_C.BINARY; 1319bool isDbNull = !QueryFieldInfo(i, ODBC32.SQL_C.WCHAR, out _); 1373isNotDbNull = GetData(i, ODBC32.SQL_C.WCHAR, cbReadMax + 2, out cbTotal); 1381isNotDbNull = GetData(i, ODBC32.SQL_C.BINARY, cbReadMax, out cbTotal); 1469if (GetData(i, ODBC32.SQL_C.BINARY, cbBufferLen, out cbActual)) 1485bool flag = GetData(i, ODBC32.SQL_C.BINARY, cbBufferLen, out cbActual); 1505while ((ODBC32.SQL_NO_TOTAL == cbActual) && GetData(i, ODBC32.SQL_C.BINARY, cbBufferLen, out cbActual)); 1686private bool QueryFieldInfo(int i, ODBC32.SQL_C sqlctype, out int cbLengthOrIndicator) 1689if (sqlctype == ODBC32.SQL_C.WCHAR) 1697private bool GetData(int i, ODBC32.SQL_C sqlctype) 1717private bool GetData(int i, ODBC32.SQL_C sqlctype, int cb, out int cbLengthOrIndicator) 1764if (sqlctype != ODBC32.SQL_C.WCHAR && sqlctype != ODBC32.SQL_C.BINARY) 2348ODBC32.SQL_C.WCHAR, 2393ODBC32.SQL_C.WCHAR, // SQLSMALLINT TargetType 2424ODBC32.SQL_C.WCHAR, 2443ODBC32.SQL_C.WCHAR, 2529ODBC32.SQL_C.WCHAR, 2535ODBC32.SQL_C.SSHORT, 2542ODBC32.SQL_C.WCHAR,
System\Data\Odbc\OdbcParameter.cs (25)
45private ODBC32.SQL_C _boundSqlCType; 69private ODBC32.SQL_C _prepared_Sql_C_Type; 320if ((ODBC32.SQL_C.NUMERIC == _bindtype!._sql_c) && (0 != _internalPrecision)) 327if (ODBC32.SQL_C.NUMERIC == _typemap!._sql_c) 336Debug.Assert((ODBC32.SQL_C.WCHAR == _bindtype._sql_c) || (ODBC32.SQL_C.BINARY == _bindtype._sql_c), "not wchar or binary"); 420if ((ODBC32.SQL_C.NUMERIC == _bindtype!._sql_c) && (0 != _internalPrecision)) 466if (ODBC32.SQL_C.NUMERIC == _typemap!._sql_c) 475Debug.Assert((ODBC32.SQL_C.WCHAR == _bindtype._sql_c) || (ODBC32.SQL_C.BINARY == _bindtype._sql_c), "not wchar or binary"); 482if (_bindtype._sql_c == ODBC32.SQL_C.WCHAR) 513else if (ODBC32.SQL_C.WCHAR == _bindtype._sql_c) 631ODBC32.SQL_C sql_c_type; 734if (sql_c_type == ODBC32.SQL_C.WCHAR) 736sql_c_type = ODBC32.SQL_C.CHAR; 795ODBC32.SQL_C sql_c_type = _prepared_Sql_C_Type; 812if (ODBC32.SQL_C.NUMERIC == sql_c_type) 894if (ODBC32.SQL_C.NUMERIC == sql_c_type) 902retcode = hdesc.SetDescriptionField1(ordinal, ODBC32.SQL_DESC.TYPE, (IntPtr)ODBC32.SQL_C.NUMERIC); 965if (_boundSqlCType == ODBC32.SQL_C.CHAR) 978Debug.Assert(ODBC32.SQL_C.NUMERIC == _typemap._sql_c, "unexpected"); 1048internal void SetInputValue(object? value, ODBC32.SQL_C sql_c_type, int cbsize, int sizeorprecision, int offset, CNativeBuffer parameterBuffer) 1067case ODBC32.SQL_C.CHAR: 1068case ODBC32.SQL_C.WCHAR: 1069case ODBC32.SQL_C.BINARY:
System\Data\Odbc\OdbcStatementHandle.cs (4)
60internal ODBC32.SQLRETURN BindColumn2(int columnNumber, ODBC32.SQL_C targetType, HandleRef buffer, IntPtr length, IntPtr srLen_or_Ind) 67internal ODBC32.SQLRETURN BindColumn3(int columnNumber, ODBC32.SQL_C targetType, IntPtr srLen_or_Ind) 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) 162internal ODBC32.SQLRETURN GetData(int index, ODBC32.SQL_C sqlctype, CNativeBuffer buffer, int cb, out IntPtr cbActual)
System\Data\Odbc\OdbcUtils.cs (32)
25internal object MarshalToManaged(int offset, ODBC32.SQL_C sqlctype, int cb) 30case ODBC32.SQL_C.WCHAR: 43case ODBC32.SQL_C.CHAR: 44case ODBC32.SQL_C.BINARY: 51case ODBC32.SQL_C.SSHORT: 55case ODBC32.SQL_C.SLONG: 59case ODBC32.SQL_C.SBIGINT: 63case ODBC32.SQL_C.BIT: 68case ODBC32.SQL_C.REAL: 72case ODBC32.SQL_C.DOUBLE: 76case ODBC32.SQL_C.UTINYINT: 80case ODBC32.SQL_C.GUID: 84case ODBC32.SQL_C.TYPE_TIMESTAMP: 101case ODBC32.SQL_C.TYPE_DATE: 113case ODBC32.SQL_C.TYPE_TIME: 124case ODBC32.SQL_C.NUMERIC: 153internal void MarshalToNative(int offset, object value, ODBC32.SQL_C sqlctype, int sizeorprecision, int valueOffset) 157case ODBC32.SQL_C.WCHAR: 201case ODBC32.SQL_C.BINARY: 202case ODBC32.SQL_C.CHAR: 228case ODBC32.SQL_C.UTINYINT: 232case ODBC32.SQL_C.SSHORT: //Int16 236case ODBC32.SQL_C.SLONG: //Int32 240case ODBC32.SQL_C.REAL: //float 244case ODBC32.SQL_C.SBIGINT: //Int64 248case ODBC32.SQL_C.DOUBLE: //Double 252case ODBC32.SQL_C.GUID: //Guid 256case ODBC32.SQL_C.BIT: 260case ODBC32.SQL_C.TYPE_TIMESTAMP: 281case ODBC32.SQL_C.TYPE_DATE: 295case ODBC32.SQL_C.TYPE_TIME: 308case ODBC32.SQL_C.NUMERIC: