1020 references to ODBC32
System.Data (1)
System.Data.cs (1)
5[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Data.Odbc.ODBC32))]
System.Data.Odbc (1019)
src\libraries\Common\src\Interop\Interop.Odbc.cs (71)
24internal static partial ODBC32.SQLRETURN SQLAllocHandle( 25/*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType, 30internal static partial ODBC32.SQLRETURN SQLAllocHandle( 31/*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType, 36internal static partial /*SQLRETURN*/ODBC32.SQLRETURN SQLBindCol( 39/*SQLSMALLINT*/ODBC32.SQL_C TargetType, 49internal static partial ODBC32.SQLRETURN SQLBindCol( 52/*SQLSMALLINT*/ODBC32.SQL_C TargetType, 58internal static partial /*SQLRETURN*/ODBC32.SQLRETURN SQLBindParameter( 62/*SQLSMALLINT*/ODBC32.SQL_C SQLCType, 79internal static partial ODBC32.SQLRETURN SQLCancel( 83internal static partial ODBC32.SQLRETURN SQLCloseCursor( 87internal static partial ODBC32.SQLRETURN SQLColAttributeW( 112internal static partial ODBC32.SQLRETURN SQLColumnsW( 124internal static partial ODBC32.SQLRETURN SQLDisconnect( 128internal static partial ODBC32.SQLRETURN SQLDriverConnectW( 139internal static partial ODBC32.SQLRETURN SQLEndTran( 140/*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType, 145internal static partial ODBC32.SQLRETURN SQLExecDirectW( 151internal static partial ODBC32.SQLRETURN SQLExecute( 155internal static partial ODBC32.SQLRETURN SQLFetch( 159internal static partial ODBC32.SQLRETURN SQLFreeHandle( 160/*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType, 164internal static partial ODBC32.SQLRETURN SQLFreeStmt( 166/*SQLUSMALLINT*/ODBC32.STMT Option); 169internal static partial ODBC32.SQLRETURN SQLGetConnectAttrW( 171/*SQLINTEGER*/ODBC32.SQL_ATTR Attribute, 177internal static partial ODBC32.SQLRETURN SQLGetData( 180/*SQLSMALLINT*/ODBC32.SQL_C TargetType, 186internal static partial ODBC32.SQLRETURN SQLGetDescFieldW( 189/*SQLUSMALLINT*/ODBC32.SQL_DESC FieldIdentifier, 195internal static partial ODBC32.SQLRETURN SQLGetDiagRecW( 196/*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType, 206internal static partial ODBC32.SQLRETURN SQLGetDiagFieldW( 207/*SQLSMALLINT*/ ODBC32.SQL_HANDLE HandleType, 216internal static partial ODBC32.SQLRETURN SQLGetFunctions( 218/*SQLUSMALLINT*/ODBC32.SQL_API fFunction, 222internal static partial ODBC32.SQLRETURN SQLGetInfoW( 224/*SQLUSMALLINT*/ODBC32.SQL_INFO fInfoType, 230internal static partial ODBC32.SQLRETURN SQLGetInfoW( 232/*SQLUSMALLINT*/ODBC32.SQL_INFO fInfoType, 238internal static partial ODBC32.SQLRETURN SQLGetStmtAttrW( 240/*SQLINTEGER*/ODBC32.SQL_ATTR Attribute, 246internal static partial ODBC32.SQLRETURN SQLGetTypeInfo( 251internal static partial ODBC32.SQLRETURN SQLMoreResults( 255internal static partial ODBC32.SQLRETURN SQLNumResultCols( 260internal static partial ODBC32.SQLRETURN SQLPrepareW( 266internal static partial ODBC32.SQLRETURN SQLPrimaryKeysW( 276internal static partial ODBC32.SQLRETURN SQLProcedureColumnsW( 288internal static partial ODBC32.SQLRETURN SQLProceduresW( 298internal static partial ODBC32.SQLRETURN SQLRowCount( 303internal static partial ODBC32.SQLRETURN SQLSetConnectAttrW( 305/*SQLINTEGER*/ODBC32.SQL_ATTR Attribute, 310internal static partial ODBC32.SQLRETURN SQLSetConnectAttrW( 312/*SQLINTEGER*/ODBC32.SQL_ATTR Attribute, 317internal static partial ODBC32.SQLRETURN SQLSetConnectAttrW( // used only for AutoCommitOn 319/*SQLINTEGER*/ODBC32.SQL_ATTR Attribute, 324internal static partial /*SQLRETURN*/ODBC32.SQLRETURN SQLSetDescFieldW( 327/*SQLSMALLINT*/ODBC32.SQL_DESC FieldIdentifier, 336internal static partial ODBC32.SQLRETURN SQLSetDescFieldW( 339/*SQLSMALLINT*/ODBC32.SQL_DESC FieldIdentifier, 345internal static partial ODBC32.SQLRETURN SQLSetEnvAttr( 347/*SQLINTEGER*/ODBC32.SQL_ATTR Attribute, 349/*SQLINTEGER*/ODBC32.SQL_IS StringLength); 352internal static partial ODBC32.SQLRETURN SQLSetStmtAttrW( 359internal static partial ODBC32.SQLRETURN SQLSpecialColumnsW( 361/*SQLUSMALLINT*/ODBC32.SQL_SPECIALCOLS IdentifierType, 368/*SQLUSMALLINT*/ODBC32.SQL_SCOPE Scope, 369/*SQLUSMALLINT*/ ODBC32.SQL_NULLABILITY Nullable); 372internal static partial ODBC32.SQLRETURN SQLStatisticsW( 384internal static partial ODBC32.SQLRETURN SQLTablesW(
System\Data\Odbc\DbDataRecord.cs (1)
15internal ODBC32.SQL_TYPE? _dbtype;
System\Data\Odbc\Odbc32.cs (126)
23internal static Exception UnknownSQLType(ODBC32.SQL_TYPE sqltype) 92internal static Exception CantEnableConnectionpooling(ODBC32.SQLRETURN retcode) 94return ADP.DataAdapter(SR.GetString(SR.Odbc_CantEnableConnectionpooling, ODBC32.RetcodeToString(retcode))); 96internal static Exception CantAllocateEnvironmentHandle(ODBC32.SQLRETURN retcode) 98return ADP.DataAdapter(SR.GetString(SR.Odbc_CantAllocateEnvironmentHandle, ODBC32.RetcodeToString(retcode))); 100internal static Exception FailedToGetDescriptorHandle(ODBC32.SQLRETURN retcode) 102return ADP.DataAdapter(SR.GetString(SR.Odbc_FailedToGetDescriptorHandle, ODBC32.RetcodeToString(retcode))); 115internal static void TraceODBC(int level, string method, ODBC32.SQLRETURN retcode) 722Debug.Assert(retcode != ODBC32.SQLRETURN.INVALID_HANDLE, "retcode must never be ODBC32.RetCode.INVALID_HANDLE"); 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; 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) 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\OdbcCommand.cs (51)
77_cmdWrapper.FreeKeyInfoStatementHandle(ODBC32.STMT.CLOSE); 78_cmdWrapper.FreeStatementHandle(ODBC32.STMT.CLOSE); 387internal OdbcDescriptorHandle GetDescriptorHandle(ODBC32.SQL_ATTR attribute) 425_cmdWrapper.FreeStatementHandle(ODBC32.STMT.RESET_PARAMS); 448ODBC32.SQLRETURN retcode = stmt.Cancel(); 453case ODBC32.SQLRETURN.SUCCESS: 454case ODBC32.SQLRETURN.SUCCESS_WITH_INFO: 565ODBC32.SQL_API method) 577return ExecuteReaderObject(behavior, method, needReader, null, ODBC32.SQL_API.SQLEXECDIRECT); 584ODBC32.SQL_API odbcApiMethod) 598ODBC32.SQLRETURN retcode; 624ODBC32.SQL_ATTR.QUERY_TIMEOUT, 645TrySetStatementAttribute(stmt, (ODBC32.SQL_ATTR)ODBC32.SQL_SOPT_SS.NOBROWSETABLE, (IntPtr)ODBC32.SQL_NB.ON); 646TrySetStatementAttribute(stmt, (ODBC32.SQL_ATTR)ODBC32.SQL_SOPT_SS.HIDDEN_COLUMNS, (IntPtr)ODBC32.SQL_HC.ON); 655TrySetStatementAttribute(stmt, (ODBC32.SQL_ATTR)ODBC32.SQL_SOPT_SS.NOBROWSETABLE, (IntPtr)ODBC32.SQL_NB.OFF); 656TrySetStatementAttribute(stmt, (ODBC32.SQL_ATTR)ODBC32.SQL_SOPT_SS.HIDDEN_COLUMNS, (IntPtr)ODBC32.SQL_HC.OFF); 670if (ODBC32.SQLRETURN.SUCCESS != retcode) 714if (retcode == ODBC32.SQLRETURN.SUCCESS || retcode == ODBC32.SQLRETURN.SUCCESS_WITH_INFO) 721else if (retcode == ODBC32.SQLRETURN.NO_DATA) 734case ODBC32.SQL_API.SQLEXECDIRECT: 754case ODBC32.SQL_API.SQLTABLES: 761case ODBC32.SQL_API.SQLCOLUMNS: 768case ODBC32.SQL_API.SQLPROCEDURES: 774case ODBC32.SQL_API.SQLPROCEDURECOLUMNS: 781case ODBC32.SQL_API.SQLSTATISTICS: 789case ODBC32.SQL_API.SQLGETTYPEINFO: 800if ((ODBC32.SQLRETURN.SUCCESS != retcode) && (ODBC32.SQLRETURN.NO_DATA != retcode)) 880ODBC32.SQLRETURN retcode; 902if (ODBC32.SQLRETURN.SUCCESS != retcode) 911private void TrySetStatementAttribute(OdbcStatementHandle stmt, ODBC32.SQL_ATTR stmtAttribute, IntPtr value) 913ODBC32.SQLRETURN retcode = stmt.SetStatementAttribute( 916ODBC32.SQL_IS.UINTEGER); 918if (retcode == ODBC32.SQLRETURN.ERROR) 1090internal void FreeStatementHandle(ODBC32.STMT stmt) 1099ODBC32.SQLRETURN retcode; 1117internal void FreeKeyInfoStatementHandle(ODBC32.STMT stmt) 1142internal OdbcDescriptorHandle GetDescriptorHandle(ODBC32.SQL_ATTR attribute) 1159internal void StatementErrorHandler(ODBC32.SQLRETURN retcode) 1163case ODBC32.SQLRETURN.SUCCESS: 1164case ODBC32.SQLRETURN.SUCCESS_WITH_INFO: 1176FreeStatementHandle(ODBC32.STMT.UNBIND);
System\Data\Odbc\OdbcCommandBuilder.cs (14)
185ODBC32.SQLRETURN retcode = hstmt.ProcedureColumns(parts[1], parts[2], parts[3], null); 190if (ODBC32.SQLRETURN.SUCCESS != retcode) 212parameter.ParameterName = reader.GetString(ODBC32.COLUMN_NAME - 1); 213switch ((ODBC32.SQL_PARAM)reader.GetInt16(ODBC32.COLUMN_TYPE - 1)) 215case ODBC32.SQL_PARAM.INPUT: 218case ODBC32.SQL_PARAM.OUTPUT: 222case ODBC32.SQL_PARAM.INPUT_OUTPUT: 225case ODBC32.SQL_PARAM.RETURN_VALUE: 232parameter.OdbcType = TypeMap.FromSqlType((ODBC32.SQL_TYPE)reader.GetInt16(ODBC32.DATA_TYPE - 1))._odbcType; 233parameter.Size = (int)reader.GetInt32(ODBC32.COLUMN_SIZE - 1); 238parameter.ScaleInternal = (byte)reader.GetInt16(ODBC32.DECIMAL_DIGITS - 1); 239parameter.PrecisionInternal = (byte)reader.GetInt16(ODBC32.NUM_PREC_RADIX - 1);
System\Data\Odbc\OdbcConnection.cs (103)
95return GetConnectAttrString(ODBC32.SQL_ATTR.CURRENT_CATALOG); 116return GetInfoStringUnhandled(ODBC32.SQL_INFO.SERVER_NAME, true)!; 212return ProviderInfo.DriverName ??= GetInfoStringUnhandled(ODBC32.SQL_INFO.DRIVER_NAME)!; 225ProviderInfo.DriverVersion = GetInfoStringUnhandled(ODBC32.SQL_INFO.DRIVER_ODBC_VER); 266escapeCharString = GetInfoStringUnhandled(ODBC32.SQL_INFO.SEARCH_PATTERN_ESCAPE)!; 279quoteCharString = GetInfoStringUnhandled(ODBC32.SQL_INFO.IDENTIFIER_QUOTE_CHAR)!; 302ConnectionHandle!.CompleteTransaction(ODBC32.SQL_ROLLBACK); 332int isDead = GetConnectAttr(ODBC32.SQL_ATTR.CONNECTION_DEAD, ODBC32.HANDLER.IGNORE); 333if (ODBC32.SQL_CD_TRUE == isDead) 381internal string GetConnectAttrString(ODBC32.SQL_ATTR attribute) 389ODBC32.SQLRETURN retcode = connectionHandle.GetConnectionAttribute(attribute, buffer, out cbActual); 397if ((ODBC32.SQLRETURN.SUCCESS == retcode) || (ODBC32.SQLRETURN.SUCCESS_WITH_INFO == retcode)) 401else if (retcode == ODBC32.SQLRETURN.ERROR) 414internal int GetConnectAttr(ODBC32.SQL_ATTR attribute, ODBC32.HANDLER handler) 421ODBC32.SQLRETURN retcode = connectionHandle.GetConnectionAttribute(attribute, buffer, out _); 423if ((ODBC32.SQLRETURN.SUCCESS == retcode) || (ODBC32.SQLRETURN.SUCCESS_WITH_INFO == retcode)) 429if (retcode == ODBC32.SQLRETURN.ERROR) 437if (handler == ODBC32.HANDLER.THROW) 454internal ODBC32.SQLRETURN GetInfoInt16Unhandled(ODBC32.SQL_INFO info, out short resultValue) 457ODBC32.SQLRETURN retcode = ConnectionHandle!.GetInfo1(info, buffer); 462internal ODBC32.SQLRETURN GetInfoInt32Unhandled(ODBC32.SQL_INFO info, out int resultValue) 465ODBC32.SQLRETURN retcode = ConnectionHandle!.GetInfo1(info, buffer); 470private int GetInfoInt32Unhandled(ODBC32.SQL_INFO infotype) 477internal string? GetInfoStringUnhandled(ODBC32.SQL_INFO info) 482private string? GetInfoStringUnhandled(ODBC32.SQL_INFO info, bool handleError) 491ODBC32.SQLRETURN retcode = connectionHandle.GetInfo2(info, buffer, out cbActual); 499if (retcode == ODBC32.SQLRETURN.SUCCESS || retcode == ODBC32.SQLRETURN.SUCCESS_WITH_INFO) 516internal Exception? HandleErrorNoThrow(OdbcHandle hrHandle, ODBC32.SQLRETURN retcode) 518Debug.Assert(retcode != ODBC32.SQLRETURN.INVALID_HANDLE, "retcode must never be ODBC32.RetCode.INVALID_HANDLE"); 522case ODBC32.SQLRETURN.SUCCESS: 524case ODBC32.SQLRETURN.SUCCESS_WITH_INFO: 530OdbcErrorCollection errors = ODBC32.GetDiagErrors(null, hrHandle, retcode); 537OdbcException e = OdbcException.CreateException(ODBC32.GetDiagErrors(null, hrHandle, retcode), retcode); 545internal void HandleError(OdbcHandle hrHandle, ODBC32.SQLRETURN retcode) 550case ODBC32.SQLRETURN.SUCCESS: 551case ODBC32.SQLRETURN.SUCCESS_WITH_INFO: 656internal void SetSupportedType(ODBC32.SQL_TYPE sqltype) 658ODBC32.SQL_CVT sqlcvt; 662case ODBC32.SQL_TYPE.NUMERIC: 664sqlcvt = ODBC32.SQL_CVT.NUMERIC; 667case ODBC32.SQL_TYPE.WCHAR: 669sqlcvt = ODBC32.SQL_CVT.WCHAR; 672case ODBC32.SQL_TYPE.WVARCHAR: 674sqlcvt = ODBC32.SQL_CVT.WVARCHAR; 677case ODBC32.SQL_TYPE.WLONGVARCHAR: 679sqlcvt = ODBC32.SQL_CVT.WLONGVARCHAR; 690internal void FlagRestrictedSqlBindType(ODBC32.SQL_TYPE sqltype) 692ODBC32.SQL_CVT sqlcvt; 696case ODBC32.SQL_TYPE.NUMERIC: 698sqlcvt = ODBC32.SQL_CVT.NUMERIC; 701case ODBC32.SQL_TYPE.DECIMAL: 703sqlcvt = ODBC32.SQL_CVT.DECIMAL; 713internal void FlagUnsupportedConnectAttr(ODBC32.SQL_ATTR Attribute) 717case ODBC32.SQL_ATTR.CURRENT_CATALOG: 720case ODBC32.SQL_ATTR.CONNECTION_DEAD: 729internal void FlagUnsupportedStmtAttr(ODBC32.SQL_ATTR Attribute) 733case ODBC32.SQL_ATTR.QUERY_TIMEOUT: 736case (ODBC32.SQL_ATTR)ODBC32.SQL_SOPT_SS.NOBROWSETABLE: 739case (ODBC32.SQL_ATTR)ODBC32.SQL_SOPT_SS.HIDDEN_COLUMNS: 748internal void FlagUnsupportedColAttr(ODBC32.SQL_DESC v3FieldId, ODBC32.SQL_COLUMN v2FieldId) 754case (ODBC32.SQL_DESC)ODBC32.SQL_CA_SS.COLUMN_KEY: 775internal bool SQLGetFunctions(ODBC32.SQL_API odbcFunction) 778ODBC32.SQLRETURN retcode; 792if (retcode != ODBC32.SQLRETURN.SUCCESS) 805internal bool TestTypeSupport(ODBC32.SQL_TYPE sqltype) 807ODBC32.SQL_CONVERT sqlconvert; 808ODBC32.SQL_CVT sqlcvt; 814case ODBC32.SQL_TYPE.NUMERIC: 816sqlconvert = ODBC32.SQL_CONVERT.NUMERIC; 817sqlcvt = ODBC32.SQL_CVT.NUMERIC; 820case ODBC32.SQL_TYPE.WCHAR: 822sqlconvert = ODBC32.SQL_CONVERT.CHAR; 823sqlcvt = ODBC32.SQL_CVT.WCHAR; 826case ODBC32.SQL_TYPE.WVARCHAR: 828sqlconvert = ODBC32.SQL_CONVERT.VARCHAR; 829sqlcvt = ODBC32.SQL_CVT.WVARCHAR; 832case ODBC32.SQL_TYPE.WLONGVARCHAR: 834sqlconvert = ODBC32.SQL_CONVERT.LONGVARCHAR; 835sqlcvt = ODBC32.SQL_CVT.WLONGVARCHAR; 848flags = GetInfoInt32Unhandled((ODBC32.SQL_INFO)sqlconvert); 860internal bool TestRestrictedSqlBindType(ODBC32.SQL_TYPE sqltype) 862ODBC32.SQL_CVT sqlcvt; 865case ODBC32.SQL_TYPE.NUMERIC: 867sqlcvt = ODBC32.SQL_CVT.NUMERIC; 870case ODBC32.SQL_TYPE.DECIMAL: 872sqlcvt = ODBC32.SQL_CVT.DECIMAL; 925ODBC32.SQLRETURN retcode = connectionHandle.BeginTransaction(ref isolevel); 926if (retcode == ODBC32.SQLRETURN.ERROR) 952ODBC32.SQLRETURN retcode = connectionHandle.SetConnectionAttribute3(ODBC32.SQL_ATTR.CURRENT_CATALOG, value, checked((int)value.Length * 2)); 954if (retcode != ODBC32.SQLRETURN.SUCCESS) 963return GetInfoStringUnhandled(ODBC32.SQL_INFO.DBMS_VER, true);
System\Data\Odbc\OdbcConnectionFactory.cs (2)
64odbcOuterConnection.GetInfoStringUnhandled(ODBC32.SQL_INFO.DRIVER_NAME); 70string versionString = odbcOuterConnection.GetInfoStringUnhandled(ODBC32.SQL_INFO.DBMS_VER)!;
System\Data\Odbc\OdbcConnectionHandle.cs (65)
23internal OdbcConnectionHandle(OdbcConnection connection, OdbcConnectionString constr, OdbcEnvironmentHandle environmentHandle) : base(ODBC32.SQL_HANDLE.DBC, environmentHandle) 34ODBC32.SQLRETURN retcode; 42SetConnectionAttribute2(ODBC32.SQL_ATTR.LOGIN_TIMEOUT, (IntPtr)connectionTimeout, (int)ODBC32.SQL_IS.UINTEGER); 54private ODBC32.SQLRETURN AutoCommitOff() 56ODBC32.SQLRETURN retcode; 64retcode = Interop.Odbc.SQLSetConnectAttrW(this, ODBC32.SQL_ATTR.AUTOCOMMIT, ODBC32.SQL_AUTOCOMMIT_OFF, (int)ODBC32.SQL_IS.UINTEGER); 67case ODBC32.SQLRETURN.SUCCESS: 68case ODBC32.SQLRETURN.SUCCESS_WITH_INFO: 77internal ODBC32.SQLRETURN BeginTransaction(ref IsolationLevel isolevel) 79ODBC32.SQLRETURN retcode = ODBC32.SQLRETURN.SUCCESS; 80ODBC32.SQL_ATTR isolationAttribute; 83ODBC32.SQL_TRANSACTION sql_iso; 87sql_iso = ODBC32.SQL_TRANSACTION.READ_UNCOMMITTED; 88isolationAttribute = ODBC32.SQL_ATTR.TXN_ISOLATION; 91sql_iso = ODBC32.SQL_TRANSACTION.READ_COMMITTED; 92isolationAttribute = ODBC32.SQL_ATTR.TXN_ISOLATION; 95sql_iso = ODBC32.SQL_TRANSACTION.REPEATABLE_READ; 96isolationAttribute = ODBC32.SQL_ATTR.TXN_ISOLATION; 99sql_iso = ODBC32.SQL_TRANSACTION.SERIALIZABLE; 100isolationAttribute = ODBC32.SQL_ATTR.TXN_ISOLATION; 103sql_iso = ODBC32.SQL_TRANSACTION.SNAPSHOT; 105isolationAttribute = ODBC32.SQL_ATTR.SQL_COPT_SS_TXN_ISOLATION; 114retcode = SetConnectionAttribute2(isolationAttribute, (IntPtr)sql_iso, (int)ODBC32.SQL_IS.INTEGER); 121if (ODBC32.SQLRETURN.SUCCESS_WITH_INFO == retcode) 129case ODBC32.SQLRETURN.SUCCESS: 130case ODBC32.SQLRETURN.SUCCESS_WITH_INFO: 139internal ODBC32.SQLRETURN CompleteTransaction(short transactionOperation) 146ODBC32.SQLRETURN retcode = CompleteTransaction(transactionOperation, base.handle); 158private ODBC32.SQLRETURN CompleteTransaction(short transactionOperation, IntPtr handle) 162ODBC32.SQLRETURN retcode = ODBC32.SQLRETURN.SUCCESS; 170if ((ODBC32.SQLRETURN.SUCCESS == retcode) || (ODBC32.SQLRETURN.SUCCESS_WITH_INFO == retcode)) 178retcode = Interop.Odbc.SQLSetConnectAttrW(handle, ODBC32.SQL_ATTR.AUTOCOMMIT, ODBC32.SQL_AUTOCOMMIT_ON, (int)ODBC32.SQL_IS.UINTEGER); 187private ODBC32.SQLRETURN Connect(string connectionString) 191ODBC32.SQLRETURN retcode; 196retcode = Interop.Odbc.SQLDriverConnectW(this, ADP.PtrZero, connectionString, ODBC32.SQL_NTS, ADP.PtrZero, 0, out _, (short)ODBC32.SQL_DRIVER.NOPROMPT); 199case ODBC32.SQLRETURN.SUCCESS: 200case ODBC32.SQLRETURN.SUCCESS_WITH_INFO: 214CompleteTransaction(ODBC32.SQL_ROLLBACK, handle); 225internal ODBC32.SQLRETURN GetConnectionAttribute(ODBC32.SQL_ATTR attribute, byte[] buffer, out int cbActual) 227ODBC32.SQLRETURN retcode = Interop.Odbc.SQLGetConnectAttrW(this, attribute, buffer, buffer.Length, out cbActual); 231internal ODBC32.SQLRETURN GetFunctions(ODBC32.SQL_API fFunction, out short fExists) 233ODBC32.SQLRETURN retcode = Interop.Odbc.SQLGetFunctions(this, fFunction, out fExists); 238internal ODBC32.SQLRETURN GetInfo2(ODBC32.SQL_INFO info, byte[] buffer, out short cbActual) 240ODBC32.SQLRETURN retcode = Interop.Odbc.SQLGetInfoW(this, info, buffer, checked((short)buffer.Length), out cbActual); 244internal ODBC32.SQLRETURN GetInfo1(ODBC32.SQL_INFO info, byte[] buffer) 246ODBC32.SQLRETURN retcode = Interop.Odbc.SQLGetInfoW(this, info, buffer, checked((short)buffer.Length), ADP.PtrZero); 250internal ODBC32.SQLRETURN SetConnectionAttribute2(ODBC32.SQL_ATTR attribute, IntPtr value, int length) 252ODBC32.SQLRETURN retcode = Interop.Odbc.SQLSetConnectAttrW(this, attribute, value, length); 257internal ODBC32.SQLRETURN SetConnectionAttribute3(ODBC32.SQL_ATTR attribute, string buffer, int length) 259ODBC32.SQLRETURN retcode = Interop.Odbc.SQLSetConnectAttrW(this, attribute, buffer, length);
System\Data\Odbc\OdbcDataReader.cs (245)
177ODBC32.SQLRETURN retcode = this.FieldCountNoThrow(out _); 178if (retcode != ODBC32.SQLRETURN.SUCCESS) 210internal ODBC32.SQLRETURN FieldCountNoThrow(out short cColsAffected) 215return ODBC32.SQLRETURN.ERROR; 218ODBC32.SQLRETURN retcode = StatementHandle.NumberOfResultColumns(out cColsAffected); 219if (retcode == ODBC32.SQLRETURN.SUCCESS) 230SQLLEN isHidden = GetColAttribute(i, (ODBC32.SQL_DESC)ODBC32.SQL_CA_SS.COLUMN_HIDDEN, (ODBC32.SQL_COLUMN)(-1), ODBC32.HANDLER.IGNORE); 262ODBC32.SQLRETURN retcode = StatementHandle.RowCount(out cRowsAffected); 263if (ODBC32.SQLRETURN.SUCCESS == retcode || ODBC32.SQLRETURN.SUCCESS_WITH_INFO == retcode) 343wrapper.FreeStatementHandle(ODBC32.STMT.CLOSE); 347wrapper.FreeKeyInfoStatementHandle(ODBC32.STMT.CLOSE); 405return info._typename ??= GetColAttributeStr(i, ODBC32.SQL_DESC.TYPE_NAME, ODBC32.SQL_COLUMN.TYPE_NAME, ODBC32.HANDLER.THROW)!; 430return info._name ??= GetColAttributeStr(i, ODBC32.SQL_DESC.NAME, ODBC32.SQL_COLUMN.NAME, ODBC32.HANDLER.THROW) ?? ""; 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: 533bool isNotDbNull = QueryFieldInfo(i, ODBC32.SQL_C.BINARY, out _); 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)); 593bool sign = (GetColAttribute(i, ODBC32.SQL_DESC.UNSIGNED, ODBC32.SQL_COLUMN.UNSIGNED, ODBC32.HANDLER.THROW).ToInt64() != 0); 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)) 966Debug.Assert(lengthOrIndicator >= 0 || lengthOrIndicator == ODBC32.SQL_NO_TOTAL, "unexpected lengthOrIndicator value"); 968if (lengthOrIndicator <= cbMaxData && (ODBC32.SQL_NO_TOTAL != lengthOrIndicator)) 986int cbBuilderInitialCapacity = (lengthOrIndicator == ODBC32.SQL_NO_TOTAL) ? cbMaxData : lengthOrIndicator; 992int cbMissing = (ODBC32.SQL_NO_TOTAL == lengthOrIndicator) ? -1 : lengthOrIndicator - cbActual; 1005gotData = GetData(i, ODBC32.SQL_C.WCHAR, buffer.Length - 2, out lengthOrIndicator); 1009Debug.Assert(lengthOrIndicator >= 0 || lengthOrIndicator == ODBC32.SQL_NO_TOTAL, "unexpected lengthOrIndicator value"); 1011if (ODBC32.SQL_NO_TOTAL != 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); 1401else if (ODBC32.SQL_NO_TOTAL == cbTotal) 1469if (GetData(i, ODBC32.SQL_C.BINARY, cbBufferLen, out cbActual)) 1473if (ODBC32.SQL_NO_TOTAL != cbActual) 1485bool flag = GetData(i, ODBC32.SQL_C.BINARY, cbBufferLen, out cbActual); 1499junkSize = (ODBC32.SQL_NO_TOTAL != cbActual) ? cbActual : cbBufferLen; 1505while ((ODBC32.SQL_NO_TOTAL == cbActual) && GetData(i, ODBC32.SQL_C.BINARY, cbBufferLen, out cbActual)); 1531private SQLLEN GetColAttribute(int iColumn, ODBC32.SQL_DESC v3FieldId, ODBC32.SQL_COLUMN v2FieldId, ODBC32.HANDLER handler) 1534ODBC32.SQLRETURN retcode; 1548else if (v2FieldId != (ODBC32.SQL_COLUMN)(-1)) 1556if (retcode != ODBC32.SQLRETURN.SUCCESS) 1558if (retcode == ODBC32.SQLRETURN.ERROR) 1565if (handler == ODBC32.HANDLER.THROW) 1583private string? GetColAttributeStr(int i, ODBC32.SQL_DESC v3FieldId, ODBC32.SQL_COLUMN v2FieldId, ODBC32.HANDLER handler) 1585ODBC32.SQLRETURN retcode; 1602else if (v2FieldId != (ODBC32.SQL_COLUMN)(-1)) 1610if ((retcode != ODBC32.SQLRETURN.SUCCESS) || (cchNameLength == 0)) 1612if (retcode == ODBC32.SQLRETURN.ERROR) 1619if (handler == ODBC32.HANDLER.THROW) 1632private string? GetDescFieldStr(int i, ODBC32.SQL_DESC attribute, ODBC32.HANDLER handler) 1649ODBC32.SQLRETURN retcode; 1653using (OdbcDescriptorHandle hdesc = new OdbcDescriptorHandle(StatementHandle, ODBC32.SQL_ATTR.APP_PARAM_DESC)) 1661if ((retcode != ODBC32.SQLRETURN.SUCCESS) || (numericAttribute == 0)) 1663if (retcode == ODBC32.SQLRETURN.ERROR) 1667Connection.FlagUnsupportedColAttr(attribute, (ODBC32.SQL_COLUMN)0); 1670if (handler == ODBC32.HANDLER.THROW) 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) 1737ODBC32.SQLRETURN retcode = StatementHandle.GetData( 1746case ODBC32.SQLRETURN.SUCCESS: 1748case ODBC32.SQLRETURN.SUCCESS_WITH_INFO: 1749if ((int)cbActual == ODBC32.SQL_NO_TOTAL) 1756case ODBC32.SQLRETURN.NO_DATA: 1764if (sqlctype != ODBC32.SQL_C.WCHAR && sqlctype != ODBC32.SQL_C.BINARY) 1769if (cbActual == (IntPtr)ODBC32.SQL_NO_TOTAL) 1785if (cbActual == (IntPtr)ODBC32.SQL_NULL_DATA) 1832ODBC32.SQLRETURN retcode; 1843case ODBC32.SQLRETURN.SUCCESS_WITH_INFO: 1848case ODBC32.SQLRETURN.SUCCESS: 1852case ODBC32.SQLRETURN.NO_DATA: 1890ODBC32.SQLRETURN retcode = FieldCountNoThrow(out cCols); 1891if ((retcode == ODBC32.SQLRETURN.SUCCESS) && (cCols == 0)) 1916ODBC32.SQLRETURN retcode, firstRetCode = ODBC32.SQLRETURN.SUCCESS; 1946hasMoreResults = ((retcode == ODBC32.SQLRETURN.SUCCESS) 1947|| (retcode == ODBC32.SQLRETURN.SUCCESS_WITH_INFO)); 1949if (retcode == ODBC32.SQLRETURN.SUCCESS_WITH_INFO) 1953else if (!disposing && (retcode != ODBC32.SQLRETURN.NO_DATA) && (ODBC32.SQLRETURN.SUCCESS != retcode)) 1961ODBC32.GetDiagErrors(errors, null, StatementHandle, retcode); 1979|| ((ODBC32.SQLRETURN.NO_DATA != retcode) && allresults && (loop < MaxConsecutiveFailure)) // or process all results until done 1982if (retcode == ODBC32.SQLRETURN.NO_DATA) 2006ODBC32.SQL_NULLABILITY nullable; 2026typeMap = TypeMap.FromSqlType((ODBC32.SQL_TYPE)unchecked((int)GetColAttribute(i, ODBC32.SQL_DESC.CONCISE_TYPE, ODBC32.SQL_COLUMN.TYPE, ODBC32.HANDLER.THROW))); 2029bool sign = (GetColAttribute(i, ODBC32.SQL_DESC.UNSIGNED, ODBC32.SQL_COLUMN.UNSIGNED, ODBC32.HANDLER.THROW).ToInt64() != 0); 2035metaInfos[i].size = GetColAttribute(i, ODBC32.SQL_DESC.OCTET_LENGTH, ODBC32.SQL_COLUMN.LENGTH, ODBC32.HANDLER.IGNORE); 2041case ODBC32.SQL_TYPE.WCHAR: 2042case ODBC32.SQL_TYPE.WLONGVARCHAR: 2043case ODBC32.SQL_TYPE.WVARCHAR: 2048metaInfos[i].precision = (byte)GetColAttribute(i, (ODBC32.SQL_DESC)ODBC32.SQL_COLUMN.PRECISION, ODBC32.SQL_COLUMN.PRECISION, ODBC32.HANDLER.IGNORE); 2049metaInfos[i].scale = (byte)GetColAttribute(i, (ODBC32.SQL_DESC)ODBC32.SQL_COLUMN.SCALE, ODBC32.SQL_COLUMN.SCALE, ODBC32.HANDLER.IGNORE); 2051metaInfos[i].isAutoIncrement = GetColAttribute(i, ODBC32.SQL_DESC.AUTO_UNIQUE_VALUE, ODBC32.SQL_COLUMN.AUTO_INCREMENT, ODBC32.HANDLER.IGNORE) == 1; 2052metaInfos[i].isReadOnly = (GetColAttribute(i, ODBC32.SQL_DESC.UPDATABLE, ODBC32.SQL_COLUMN.UPDATABLE, ODBC32.HANDLER.IGNORE) == (int)ODBC32.SQL_UPDATABLE.READONLY); 2054nullable = (ODBC32.SQL_NULLABILITY)(int)GetColAttribute(i, ODBC32.SQL_DESC.NULLABLE, ODBC32.SQL_COLUMN.NULLABLE, ODBC32.HANDLER.IGNORE); 2055metaInfos[i].isNullable = (nullable == ODBC32.SQL_NULLABILITY.NULLABLE); 2059case ODBC32.SQL_TYPE.LONGVARCHAR: 2060case ODBC32.SQL_TYPE.WLONGVARCHAR: 2061case ODBC32.SQL_TYPE.LONGVARBINARY: 2076isKeyColumn = GetColAttribute(i, (ODBC32.SQL_DESC)ODBC32.SQL_CA_SS.COLUMN_KEY, (ODBC32.SQL_COLUMN)(-1), ODBC32.HANDLER.IGNORE) == 1; 2086metaInfos[i].baseSchemaName = GetColAttributeStr(i, ODBC32.SQL_DESC.SCHEMA_NAME, ODBC32.SQL_COLUMN.OWNER_NAME, ODBC32.HANDLER.IGNORE); 2087metaInfos[i].baseCatalogName = GetColAttributeStr(i, ODBC32.SQL_DESC.CATALOG_NAME, (ODBC32.SQL_COLUMN)(-1), ODBC32.HANDLER.IGNORE); 2088metaInfos[i].baseTableName = GetColAttributeStr(i, ODBC32.SQL_DESC.BASE_TABLE_NAME, ODBC32.SQL_COLUMN.TABLE_NAME, ODBC32.HANDLER.IGNORE); 2089metaInfos[i].baseColumnName = GetColAttributeStr(i, ODBC32.SQL_DESC.BASE_COLUMN_NAME, ODBC32.SQL_COLUMN.NAME, ODBC32.HANDLER.IGNORE); 2097metaInfos[i].baseTableName = GetDescFieldStr(i, ODBC32.SQL_DESC.BASE_TABLE_NAME, ODBC32.HANDLER.IGNORE); 2103metaInfos[i].baseColumnName = GetDescFieldStr(i, ODBC32.SQL_DESC.BASE_COLUMN_NAME, ODBC32.HANDLER.IGNORE); 2115if (nullable == ODBC32.SQL_NULLABILITY.UNKNOWN) 2127isKeyColumn = GetColAttribute(i, (ODBC32.SQL_DESC)ODBC32.SQL_CA_SS.COLUMN_KEY, (ODBC32.SQL_COLUMN)(-1), ODBC32.HANDLER.IGNORE) == 1; 2130isHidden = GetColAttribute(i, (ODBC32.SQL_DESC)ODBC32.SQL_CA_SS.COLUMN_HIDDEN, (ODBC32.SQL_COLUMN)(-1), ODBC32.HANDLER.IGNORE) == 1; 2310ODBC32.SQLRETURN retcode; 2340if ((retcode == ODBC32.SQLRETURN.SUCCESS) || (retcode == ODBC32.SQLRETURN.SUCCESS_WITH_INFO)) 2347(short)(ODBC32.SQL_PRIMARYKEYS.COLUMNNAME), // Column Number 2348ODBC32.SQL_C.WCHAR, 2352while (ODBC32.SQLRETURN.SUCCESS == (retcode = KeyInfoStatementHandle.Fetch())) 2392(short)(ODBC32.SQL_PRIMARYKEYS.COLUMNNAME), // SQLUSMALLINT ColumnNumber 2393ODBC32.SQL_C.WCHAR, // SQLSMALLINT TargetType 2417if ((retcode == ODBC32.SQLRETURN.SUCCESS) || (retcode == ODBC32.SQLRETURN.SUCCESS_WITH_INFO)) 2423(short)(ODBC32.SQL_SPECIALCOLUMNSET.COLUMN_NAME), 2424ODBC32.SQL_C.WCHAR, 2429while (ODBC32.SQLRETURN.SUCCESS == (retcode = KeyInfoStatementHandle.Fetch())) 2442(short)(ODBC32.SQL_SPECIALCOLUMNSET.COLUMN_NAME), 2443ODBC32.SQL_C.WCHAR, 2474ODBC32.SQLRETURN retcode; 2497if (retcode != ODBC32.SQLRETURN.SUCCESS) 2528(short)(ODBC32.SQL_STATISTICS.INDEXNAME), 2529ODBC32.SQL_C.WCHAR, 2534(short)(ODBC32.SQL_STATISTICS.ORDINAL_POSITION), 2535ODBC32.SQL_C.SSHORT, 2541(short)(ODBC32.SQL_STATISTICS.COLUMN_NAME), 2542ODBC32.SQL_C.WCHAR, 2548while (ODBC32.SQLRETURN.SUCCESS == (retcode = KeyInfoStatementHandle.Fetch())) 2642_cmdWrapper!.FreeKeyInfoStatementHandle(ODBC32.STMT.UNBIND);
System\Data\Odbc\OdbcEnvironmentHandle.cs (10)
11public OdbcEnvironmentHandle() : base(ODBC32.SQL_HANDLE.ENV, null) 13ODBC32.SQLRETURN retcode; 19ODBC32.SQL_ATTR.ODBC_VERSION, 20ODBC32.SQL_OV_ODBC3, 21ODBC32.SQL_IS.INTEGER); 31ODBC32.SQL_ATTR.CONNECTION_POOLING, 32ODBC32.SQL_CP_ONE_PER_HENV, 33ODBC32.SQL_IS.INTEGER); 37case ODBC32.SQLRETURN.SUCCESS: 38case ODBC32.SQLRETURN.SUCCESS_WITH_INFO:
System\Data\Odbc\OdbcException.cs (4)
16internal static OdbcException CreateException(OdbcErrorCollection errors, ODBC32.SQLRETURN retcode) 26builder.Append(SR.GetString(SR.Odbc_ExceptionMessage, ODBC32.RetcodeToString(retcode), error.SQLState, error.Message)); // MDAC 68337 63si.AddValue("odbcRetcode", default(ODBC32.RETCODE), typeof(ODBC32.RETCODE)); // Using default value of ODBC32.RETCODE
System\Data\Odbc\OdbcHandle.cs (40)
14private readonly ODBC32.SQL_HANDLE _handleType; 17protected OdbcHandle(ODBC32.SQL_HANDLE handleType, OdbcHandle? parentHandle) : base(IntPtr.Zero, true) 22ODBC32.SQLRETURN retcode = ODBC32.SQLRETURN.SUCCESS; 29case ODBC32.SQL_HANDLE.ENV: 33case ODBC32.SQL_HANDLE.DBC: 34case ODBC32.SQL_HANDLE.STMT: 53case ODBC32.SQL_HANDLE.DBC: 54case ODBC32.SQL_HANDLE.STMT: 71if ((ADP.PtrZero == base.handle) || (ODBC32.SQLRETURN.SUCCESS != retcode)) 78internal OdbcHandle(OdbcStatementHandle parentHandle, ODBC32.SQL_ATTR attribute) : base(IntPtr.Zero, true) 80Debug.Assert((ODBC32.SQL_ATTR.APP_PARAM_DESC == attribute) || (ODBC32.SQL_ATTR.APP_ROW_DESC == attribute), "invalid attribute"); 81_handleType = ODBC32.SQL_HANDLE.DESC; 84ODBC32.SQLRETURN retcode; 118internal ODBC32.SQL_HANDLE HandleType 143ODBC32.SQL_HANDLE handleType = HandleType; 147case ODBC32.SQL_HANDLE.DBC: 149case ODBC32.SQL_HANDLE.ENV: 150case ODBC32.SQL_HANDLE.STMT: 154case ODBC32.SQL_HANDLE.DESC: 176internal ODBC32.SQLRETURN GetDiagnosticField(out string sqlState) 180ODBC32.SQLRETURN retcode = Interop.Odbc.SQLGetDiagFieldW( 184ODBC32.SQL_DIAG_SQLSTATE, 189if ((retcode == ODBC32.SQLRETURN.SUCCESS) || (retcode == ODBC32.SQLRETURN.SUCCESS_WITH_INFO)) 200internal ODBC32.SQLRETURN GetDiagnosticRecord(short record, out string sqlState, StringBuilder messageBuilder, out int nativeError, out short cchActual) 206ODBC32.SQLRETURN retcode = Interop.Odbc.SQLGetDiagRecW(HandleType, this, record, buffer, out nativeError, message, checked((short)message.Length), out cchActual); 209if ((retcode == ODBC32.SQLRETURN.SUCCESS) || (retcode == ODBC32.SQLRETURN.SUCCESS_WITH_INFO)) 224internal OdbcDescriptorHandle(OdbcStatementHandle statementHandle, ODBC32.SQL_ATTR attribute) : base(statementHandle, attribute) 228internal ODBC32.SQLRETURN GetDescriptionField(int i, ODBC32.SQL_DESC attribute, CNativeBuffer buffer, out int numericAttribute) 230ODBC32.SQLRETURN retcode = Interop.Odbc.SQLGetDescFieldW(this, checked((short)i), attribute, buffer, buffer.ShortLength, out numericAttribute); 235internal ODBC32.SQLRETURN SetDescriptionField1(short ordinal, ODBC32.SQL_DESC type, IntPtr value) 237ODBC32.SQLRETURN retcode = Interop.Odbc.SQLSetDescFieldW(this, ordinal, type, value, 0); 242internal ODBC32.SQLRETURN SetDescriptionField2(short ordinal, ODBC32.SQL_DESC type, HandleRef value) 244ODBC32.SQLRETURN retcode = Interop.Odbc.SQLSetDescFieldW(this, ordinal, type, value, 0);
System\Data\Odbc\OdbcMetaDataFactory.cs (100)
16internal SchemaFunctionName(string schemaName, ODBC32.SQL_API odbcFunction) 22internal readonly ODBC32.SQL_API _odbcFunction; 42new SchemaFunctionName(DbMetaDataCollectionNames.DataTypes, ODBC32.SQL_API.SQLGETTYPEINFO), 43new SchemaFunctionName(OdbcMetaDataCollectionNames.Columns, ODBC32.SQL_API.SQLCOLUMNS), 44new SchemaFunctionName(OdbcMetaDataCollectionNames.Indexes, ODBC32.SQL_API.SQLSTATISTICS), 45new SchemaFunctionName(OdbcMetaDataCollectionNames.Procedures, ODBC32.SQL_API.SQLPROCEDURES), 46new SchemaFunctionName(OdbcMetaDataCollectionNames.ProcedureColumns, ODBC32.SQL_API.SQLPROCEDURECOLUMNS), 47new SchemaFunctionName(OdbcMetaDataCollectionNames.ProcedureParameters, ODBC32.SQL_API.SQLPROCEDURECOLUMNS), 48new SchemaFunctionName(OdbcMetaDataCollectionNames.Tables, ODBC32.SQL_API.SQLTABLES), 49new SchemaFunctionName(OdbcMetaDataCollectionNames.Views, ODBC32.SQL_API.SQLTABLES)}; 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: 357switch ((ODBC32.SQL_NULLABILITY)Convert.ToInt16(getTypeInfoValues[indexNULLABLE], null)) 359case ODBC32.SQL_NULLABILITY.NO_NULLS: 363case ODBC32.SQL_NULLABILITY.NULLABLE: 367case ODBC32.SQL_NULLABILITY.UNKNOWN: 379case (short)ODBC32.SQL_SEARCHABLE.UNSEARCHABLE: 384case (short)ODBC32.SQL_SEARCHABLE.LIKE_ONLY: 389case (short)ODBC32.SQL_SEARCHABLE.ALL_EXCEPT_LIKE: 394case (short)ODBC32.SQL_SEARCHABLE.SEARCHABLE: 466if ((((short)values[positionOfColumnType] == ODBC32.SQL_RESULT_COL) && isColumn) || 467(((short)values[positionOfColumnType] != ODBC32.SQL_RESULT_COL) && !isColumn)) 545dataReader = command.ExecuteReaderFromSQLMethod(allRestrictions, ODBC32.SQL_API.SQLCOLUMNS); 587ODBC32.SQLRETURN retcode; 590stringValue = connection.GetInfoStringUnhandled(ODBC32.SQL_INFO.CATALOG_NAME_SEPARATOR); 599stringValue = connection.GetInfoStringUnhandled(ODBC32.SQL_INFO.DBMS_NAME); 621retcode = connection.GetInfoInt32Unhandled(ODBC32.SQL_INFO.SQL_OJ_CAPABILITIES_30, out int32Value); 625retcode = connection.GetInfoInt32Unhandled(ODBC32.SQL_INFO.SQL_OJ_CAPABILITIES_20, out int32Value); 628if ((retcode == ODBC32.SQLRETURN.SUCCESS) || (retcode == ODBC32.SQLRETURN.SUCCESS_WITH_INFO)) 631if ((int32Value & (int)ODBC32.SQL_OJ_CAPABILITIES.LEFT) != 0) 635if ((int32Value & (int)ODBC32.SQL_OJ_CAPABILITIES.RIGHT) != 0) 639if ((int32Value & (int)ODBC32.SQL_OJ_CAPABILITIES.FULL) != 0) 643if ((int32Value & (int)ODBC32.SQL_OJ_CAPABILITIES.INNER) != 0) 652retcode = connection.GetInfoInt16Unhandled(ODBC32.SQL_INFO.GROUP_BY, out int16Value); 655if ((retcode == ODBC32.SQLRETURN.SUCCESS) || (retcode == ODBC32.SQLRETURN.SUCCESS_WITH_INFO)) 659case (short)ODBC32.SQL_GROUP_BY.NOT_SUPPORTED: 663case (short)ODBC32.SQL_GROUP_BY.GROUP_BY_EQUALS_SELECT: 667case (short)ODBC32.SQL_GROUP_BY.GROUP_BY_CONTAINS_SELECT: 671case (short)ODBC32.SQL_GROUP_BY.NO_RELATION: 685retcode = connection.GetInfoInt16Unhandled(ODBC32.SQL_INFO.IDENTIFIER_CASE, out int16Value); 688if ((retcode == ODBC32.SQLRETURN.SUCCESS) || (retcode == ODBC32.SQLRETURN.SUCCESS_WITH_INFO)) 692case (short)ODBC32.SQL_IDENTIFIER_CASE.SENSITIVE: 696case (short)ODBC32.SQL_IDENTIFIER_CASE.UPPER: 697case (short)ODBC32.SQL_IDENTIFIER_CASE.LOWER: 698case (short)ODBC32.SQL_IDENTIFIER_CASE.MIXED: 706stringValue = connection.GetInfoStringUnhandled(ODBC32.SQL_INFO.ORDER_BY_COLUMNS_IN_SELECT); 752retcode = connection.GetInfoInt16Unhandled(ODBC32.SQL_INFO.QUOTED_IDENTIFIER_CASE, out int16Value); 755if ((retcode == ODBC32.SQLRETURN.SUCCESS) || (retcode == ODBC32.SQLRETURN.SUCCESS_WITH_INFO)) 759case (short)ODBC32.SQL_IDENTIFIER_CASE.SENSITIVE: 763case (short)ODBC32.SQL_IDENTIFIER_CASE.UPPER: 764case (short)ODBC32.SQL_IDENTIFIER_CASE.LOWER: 765case (short)ODBC32.SQL_IDENTIFIER_CASE.MIXED: 800allArguments[0] = ODBC32.SQL_ALL_TYPES; 807dataReader = command.ExecuteReaderFromSQLMethod(allArguments, ODBC32.SQL_API.SQLGETTYPEINFO); 842allRestrictions[3] = (short)ODBC32.SQL_INDEX.ALL; 843allRestrictions[4] = (short)ODBC32.SQL_STATISTICS_RESERVED.ENSURE; 845dataReader = command.ExecuteReaderFromSQLMethod(allRestrictions, ODBC32.SQL_API.SQLSTATISTICS); 882dataReader = command.ExecuteReaderFromSQLMethod(allRestrictions, ODBC32.SQL_API.SQLPROCEDURECOLUMNS); 921dataReader = command.ExecuteReaderFromSQLMethod(allRestrictions, ODBC32.SQL_API.SQLPROCEDURES); 933procedureType = (short)ODBC32.SQL_PROCEDURETYPE.UNKNOWN; 938procedureType = (short)ODBC32.SQL_PROCEDURETYPE.PROCEDURE; 943procedureType = (short)ODBC32.SQL_PROCEDURETYPE.FUNCTION; 985string? keywords = connection.GetInfoStringUnhandled(ODBC32.SQL_INFO.KEYWORDS); 1033dataReader = command.ExecuteReaderFromSQLMethod(allArguments, ODBC32.SQL_API.SQLTABLES); 1051if (rowIndexType == (short)ODBC32.SQL_STATISTICSTYPE.TABLE_STAT)
System\Data\Odbc\OdbcParameter.cs (69)
45private ODBC32.SQL_C _boundSqlCType; 46private ODBC32.SQL_TYPE _boundParameterType; // if we bound already that is the type we used 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"); 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)) 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; 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) 734if (sql_c_type == ODBC32.SQL_C.WCHAR) 736sql_c_type = ODBC32.SQL_C.CHAR; 757case ODBC32.SQL_TYPE.VARBINARY: 764case ODBC32.SQL_TYPE.VARCHAR: 771case ODBC32.SQL_TYPE.WVARCHAR: 794ODBC32.SQLRETURN retcode; 795ODBC32.SQL_C sql_c_type = _prepared_Sql_C_Type; 796ODBC32.SQL_PARAM sqldirection = SqlDirectionFromParameterDirection(); 812if (ODBC32.SQL_C.NUMERIC == sql_c_type) 817if ((ODBC32.SQL_PARAM.INPUT_OUTPUT == sqldirection) && (value is decimal)) 833if (ODBC32.SQL_PARAM.INPUT != sqldirection) 873if (ODBC32.SQLRETURN.SUCCESS != retcode) 894if (ODBC32.SQL_C.NUMERIC == sql_c_type) 896OdbcDescriptorHandle hdesc = command.GetDescriptorHandle(ODBC32.SQL_ATTR.APP_PARAM_DESC); 902retcode = hdesc.SetDescriptionField1(ordinal, ODBC32.SQL_DESC.TYPE, (IntPtr)ODBC32.SQL_C.NUMERIC); 904if (ODBC32.SQLRETURN.SUCCESS != retcode) 914retcode = hdesc.SetDescriptionField1(ordinal, ODBC32.SQL_DESC.PRECISION, (IntPtr)cbActual); 916if (ODBC32.SQLRETURN.SUCCESS != retcode) 926retcode = hdesc.SetDescriptionField1(ordinal, ODBC32.SQL_DESC.SCALE, (IntPtr)cbActual); 928if (ODBC32.SQLRETURN.SUCCESS != retcode) 936retcode = hdesc.SetDescriptionField2(ordinal, ODBC32.SQL_DESC.DATA_PTR, valueBuffer); 938if (ODBC32.SQLRETURN.SUCCESS != retcode) 957if (ODBC32.SQL_NULL_DATA == cbActual) 961else if ((0 <= cbActual) || (cbActual == ODBC32.SQL_NTS)) 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) 1057parameterBuffer.WriteIntPtr(_preparedIntOffset, (IntPtr)ODBC32.SQL_DEFAULT_PARAM); 1061parameterBuffer.WriteIntPtr(_preparedIntOffset, (IntPtr)ODBC32.SQL_NULL_DATA); 1067case ODBC32.SQL_C.CHAR: 1068case ODBC32.SQL_C.WCHAR: 1069case ODBC32.SQL_C.BINARY: 1090parameterBuffer.WriteIntPtr(_preparedIntOffset, (IntPtr)ODBC32.SQL_NULL_DATA); 1094private ODBC32.SQL_PARAM SqlDirectionFromParameterDirection() 1099return ODBC32.SQL_PARAM.INPUT; 1104return ODBC32.SQL_PARAM.OUTPUT; 1106return ODBC32.SQL_PARAM.INPUT_OUTPUT; 1109return ODBC32.SQL_PARAM.INPUT;
System\Data\Odbc\OdbcStatementHandle.cs (68)
56internal OdbcStatementHandle(OdbcConnectionHandle? connectionHandle) : base(ODBC32.SQL_HANDLE.STMT, connectionHandle) 60internal ODBC32.SQLRETURN BindColumn2(int columnNumber, ODBC32.SQL_C targetType, HandleRef buffer, IntPtr length, IntPtr srLen_or_Ind) 62ODBC32.SQLRETURN retcode = Interop.Odbc.SQLBindCol(this, checked((ushort)columnNumber), targetType, buffer, length, srLen_or_Ind); 67internal ODBC32.SQLRETURN BindColumn3(int columnNumber, ODBC32.SQL_C targetType, IntPtr srLen_or_Ind) 69ODBC32.SQLRETURN retcode = Interop.Odbc.SQLBindCol(this, checked((ushort)columnNumber), targetType, ADP.PtrZero, ADP.PtrZero, 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) 76ODBC32.SQLRETURN retcode = Interop.Odbc.SQLBindParameter(this, 90internal ODBC32.SQLRETURN Cancel() 94ODBC32.SQLRETURN retcode = Interop.Odbc.SQLCancel(this); 99internal ODBC32.SQLRETURN CloseCursor() 101ODBC32.SQLRETURN retcode = Interop.Odbc.SQLCloseCursor(this); 106internal ODBC32.SQLRETURN ColumnAttribute(int columnNumber, short fieldIdentifier, CNativeBuffer characterAttribute, out short stringLength, out SQLLEN numericAttribute) 109ODBC32.SQLRETURN retcode = Interop.Odbc.SQLColAttributeW(this, checked((short)columnNumber), fieldIdentifier, characterAttribute, characterAttribute.ShortLength, out stringLength, out result); 115internal ODBC32.SQLRETURN Columns(string tableCatalog, 120ODBC32.SQLRETURN retcode = Interop.Odbc.SQLColumnsW(this, 134internal ODBC32.SQLRETURN Execute() 136ODBC32.SQLRETURN retcode = Interop.Odbc.SQLExecute(this); 141internal ODBC32.SQLRETURN ExecuteDirect(string commandText) 143ODBC32.SQLRETURN retcode = Interop.Odbc.SQLExecDirectW(this, commandText, ODBC32.SQL_NTS); 148internal ODBC32.SQLRETURN Fetch() 150ODBC32.SQLRETURN retcode = Interop.Odbc.SQLFetch(this); 155internal ODBC32.SQLRETURN FreeStatement(ODBC32.STMT stmt) 157ODBC32.SQLRETURN retcode = Interop.Odbc.SQLFreeStmt(this, stmt); 162internal ODBC32.SQLRETURN GetData(int index, ODBC32.SQL_C sqlctype, CNativeBuffer buffer, int cb, out IntPtr cbActual) 164ODBC32.SQLRETURN retcode = Interop.Odbc.SQLGetData(this, 174internal ODBC32.SQLRETURN GetStatementAttribute(ODBC32.SQL_ATTR attribute, out IntPtr value, out int stringLength) 176ODBC32.SQLRETURN retcode = Interop.Odbc.SQLGetStmtAttrW(this, attribute, out value, ADP.PtrSize, out stringLength); 181internal ODBC32.SQLRETURN GetTypeInfo(short fSqlType) 183ODBC32.SQLRETURN retcode = Interop.Odbc.SQLGetTypeInfo(this, fSqlType); 188internal ODBC32.SQLRETURN MoreResults() 190ODBC32.SQLRETURN retcode = Interop.Odbc.SQLMoreResults(this); 195internal ODBC32.SQLRETURN NumberOfResultColumns(out short columnsAffected) 197ODBC32.SQLRETURN retcode = Interop.Odbc.SQLNumResultCols(this, out columnsAffected); 202internal ODBC32.SQLRETURN Prepare(string commandText) 204ODBC32.SQLRETURN retcode = Interop.Odbc.SQLPrepareW(this, commandText, ODBC32.SQL_NTS); 209internal ODBC32.SQLRETURN PrimaryKeys(string? catalogName, string? schemaName, string tableName) 211ODBC32.SQLRETURN retcode = Interop.Odbc.SQLPrimaryKeysW(this, 220internal ODBC32.SQLRETURN Procedures(string procedureCatalog, 224ODBC32.SQLRETURN retcode = Interop.Odbc.SQLProceduresW(this, 236internal ODBC32.SQLRETURN ProcedureColumns(string? procedureCatalog, 241ODBC32.SQLRETURN retcode = Interop.Odbc.SQLProcedureColumnsW(this, 255internal ODBC32.SQLRETURN RowCount(out SQLLEN rowCount) 258ODBC32.SQLRETURN retcode = Interop.Odbc.SQLRowCount(this, out result); 264internal ODBC32.SQLRETURN SetStatementAttribute(ODBC32.SQL_ATTR attribute, IntPtr value, ODBC32.SQL_IS stringLength) 266ODBC32.SQLRETURN retcode = Interop.Odbc.SQLSetStmtAttrW(this, (int)attribute, value, (int)stringLength); 271internal ODBC32.SQLRETURN SpecialColumns(string quotedTable) 273ODBC32.SQLRETURN retcode = Interop.Odbc.SQLSpecialColumnsW(this, 274ODBC32.SQL_SPECIALCOLS.ROWVER, null, 0, null, 0, 276ODBC32.SQL_SCOPE.SESSION, ODBC32.SQL_NULLABILITY.NO_NULLS); 281internal ODBC32.SQLRETURN Statistics(string? tableCatalog, 287ODBC32.SQLRETURN retcode; 314internal ODBC32.SQLRETURN Statistics(string tableName) 316return Statistics(null, null, tableName, (short)ODBC32.SQL_INDEX.UNIQUE, (short)ODBC32.SQL_STATISTICS_RESERVED.ENSURE); 319internal ODBC32.SQLRETURN Tables(string tableCatalog, 324ODBC32.SQLRETURN retcode = Interop.Odbc.SQLTablesW(this,
System\Data\Odbc\OdbcTransaction.cs (17)
53int sql_iso = connection.GetConnectAttr(ODBC32.SQL_ATTR.TXN_ISOLATION, ODBC32.HANDLER.THROW); 54_isolevel = (ODBC32.SQL_TRANSACTION)sql_iso switch 56ODBC32.SQL_TRANSACTION.READ_UNCOMMITTED => IsolationLevel.ReadUncommitted, 57ODBC32.SQL_TRANSACTION.READ_COMMITTED => IsolationLevel.ReadCommitted, 58ODBC32.SQL_TRANSACTION.REPEATABLE_READ => IsolationLevel.RepeatableRead, 59ODBC32.SQL_TRANSACTION.SERIALIZABLE => IsolationLevel.Serializable, 60ODBC32.SQL_TRANSACTION.SNAPSHOT => IsolationLevel.Snapshot, 85ODBC32.SQLRETURN retcode = _handle.CompleteTransaction(ODBC32.SQL_COMMIT); 86if (retcode == ODBC32.SQLRETURN.ERROR) 109ODBC32.SQLRETURN retcode = handle.CompleteTransaction(ODBC32.SQL_ROLLBACK); 110if (retcode == ODBC32.SQLRETURN.ERROR) 158ODBC32.SQLRETURN retcode = _handle.CompleteTransaction(ODBC32.SQL_ROLLBACK); 159if (retcode == ODBC32.SQLRETURN.ERROR)
System\Data\Odbc\OdbcUtils.cs (33)
25internal object MarshalToManaged(int offset, ODBC32.SQL_C sqlctype, int cb) 30case ODBC32.SQL_C.WCHAR: 32if (cb == ODBC32.SQL_NTS) 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: