1044 references to ODBC32
System.Data (1044)
fx\src\data\System\Data\Common\System.Data_BID.cs (4)
301[BidArgumentType(typeof(System.Int32))] System.Data.Odbc.ODBC32.RetCode a1) { 302if (((System.Data.Odbc.ODBC32.RetCode.SUCCESS != a1) || (modFlags & ApiGroup.StatusOk) != 0) && (modFlags & ApiGroup.Trace) != 0 && modID != NoData) 309[BidArgumentType(typeof(System.Int32))] System.Data.Odbc.ODBC32.RetCode a1, 311if (((System.Data.Odbc.ODBC32.RetCode.SUCCESS != a1) || (modFlags & ApiGroup.StatusOk) != 0) && (modFlags & ApiGroup.Trace) != 0 && modID != NoData)
fx\src\data\System\Data\Common\UnsafeNativeMethods.cs (73)
31static internal extern /*SQLRETURN*/ODBC32.RetCode SQLAllocHandle( 32/*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType, 39static internal extern /*SQLRETURN*/ODBC32.RetCode SQLAllocHandle( 40/*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType, 47static internal extern /*SQLRETURN*/ODBC32.RetCode SQLBindCol( 50/*SQLSMALLINT*/ODBC32.SQL_C TargetType, 57static internal extern /*SQLRETURN*/ODBC32.RetCode SQLBindCol( 60/*SQLSMALLINT*/ODBC32.SQL_C TargetType, 67static internal extern /*SQLRETURN*/ODBC32.RetCode SQLBindParameter( 71/*SQLSMALLINT*/ODBC32.SQL_C SQLCType, 81static internal extern /*SQLRETURN*/ODBC32.RetCode SQLCancel( 86static internal extern /*SQLRETURN*/ODBC32.RetCode SQLCloseCursor( 91static internal extern /*SQLRETURN*/ODBC32.RetCode SQLColAttributeW ( 118static internal extern /*SQLRETURN*/ODBC32.RetCode SQLColumnsW ( 136static internal extern /*SQLRETURN*/ODBC32.RetCode SQLDisconnect( 142static internal extern /*SQLRETURN*/ODBC32.RetCode SQLDriverConnectW( 156static internal extern /*SQLRETURN*/ODBC32.RetCode SQLEndTran( 157/*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType, 163static internal extern /*SQLRETURN*/ODBC32.RetCode SQLExecDirectW( 171static internal extern /*SQLRETURN*/ODBC32.RetCode SQLExecute( 176static internal extern /*SQLRETURN*/ODBC32.RetCode SQLFetch( 182static internal extern /*SQLRETURN*/ODBC32.RetCode SQLFreeHandle( 183/*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType, 188static internal extern /*SQLRETURN*/ODBC32.RetCode SQLFreeStmt( 190/*SQLUSMALLINT*/ODBC32.STMT Option); 194static internal extern /*SQLRETURN*/ODBC32.RetCode SQLGetConnectAttrW( 196/*SQLINTEGER*/ODBC32.SQL_ATTR Attribute, 203static internal extern /*SQLRETURN*/ODBC32.RetCode SQLGetData( 206/*SQLSMALLINT*/ODBC32.SQL_C TargetType, 213static internal extern /*SQLRETURN*/ODBC32.RetCode SQLGetDescFieldW ( 216/*SQLUSMALLINT*/ODBC32.SQL_DESC FieldIdentifier, 223static internal extern /*SQLRETURN*/ODBC32.RetCode SQLGetDiagRecW( 224/*SQLSMALLINT*/ODBC32.SQL_HANDLE HandleType, 235static internal extern /*SQLRETURN*/ODBC32.RetCode SQLGetDiagFieldW( 236/*SQLSMALLINT*/ ODBC32.SQL_HANDLE HandleType, 247static internal extern /*SQLRETURN*/ODBC32.RetCode SQLGetFunctions( 249/*SQLUSMALLINT*/ODBC32.SQL_API fFunction, 254static internal extern /*SQLRETURN*/ODBC32.RetCode SQLGetInfoW( 256/*SQLUSMALLINT*/ODBC32.SQL_INFO fInfoType, 263static internal extern /*SQLRETURN*/ODBC32.RetCode SQLGetInfoW( 265/*SQLUSMALLINT*/ODBC32.SQL_INFO fInfoType, 272static internal extern /*SQLRETURN*/ODBC32.RetCode SQLGetStmtAttrW( 274/*SQLINTEGER*/ODBC32.SQL_ATTR Attribute, 281static internal extern /*SQLRETURN*/ODBC32.RetCode SQLGetTypeInfo( 287static internal extern /*SQLRETURN*/ODBC32.RetCode SQLMoreResults( 292static internal extern /*SQLRETURN*/ODBC32.RetCode SQLNumResultCols( 298static internal extern /*SQLRETURN*/ODBC32.RetCode SQLPrepareW( 306static internal extern /*SQLRETURN*/ODBC32.RetCode SQLPrimaryKeysW ( 320static internal extern /*SQLRETURN*/ODBC32.RetCode SQLProcedureColumnsW ( 333static internal extern /*SQLRETURN*/ODBC32.RetCode SQLProceduresW ( 344static internal extern /*SQLRETURN*/ODBC32.RetCode SQLRowCount( 350static internal extern /*SQLRETURN*/ODBC32.RetCode SQLSetConnectAttrW( 352/*SQLINTEGER*/ODBC32.SQL_ATTR Attribute, 358static internal extern /*SQLRETURN*/ODBC32.RetCode SQLSetConnectAttrW( 360/*SQLINTEGER*/ODBC32.SQL_ATTR Attribute, 366static internal extern /*SQLRETURN*/ODBC32.RetCode SQLSetConnectAttrW( 368/*SQLINTEGER*/ODBC32.SQL_ATTR Attribute, 375static internal extern /*SQLRETURN*/ODBC32.RetCode SQLSetConnectAttrW( // used only for AutoCommitOn 377/*SQLINTEGER*/ODBC32.SQL_ATTR Attribute, 383static internal extern /*SQLRETURN*/ODBC32.RetCode SQLSetDescFieldW ( 386/*SQLSMALLINT*/ODBC32.SQL_DESC FieldIdentifier, 392static internal extern /*SQLRETURN*/ODBC32.RetCode SQLSetDescFieldW ( 395/*SQLSMALLINT*/ODBC32.SQL_DESC FieldIdentifier, 402static internal extern /*SQLRETURN*/ODBC32.RetCode SQLSetEnvAttr( 404/*SQLINTEGER*/ODBC32.SQL_ATTR Attribute, 406/*SQLINTEGER*/ODBC32.SQL_IS StringLength); 410static internal extern /*SQLRETURN*/ODBC32.RetCode SQLSetStmtAttrW( 418static internal extern /*SQLRETURN*/ODBC32.RetCode SQLSpecialColumnsW ( 420/*SQLUSMALLINT*/ODBC32.SQL_SPECIALCOLS IdentifierType, 430/*SQLUSMALLINT*/ODBC32.SQL_SCOPE Scope, 431/*SQLUSMALLINT*/ ODBC32.SQL_NULLABILITY Nullable); 435static internal extern /*SQLRETURN*/ODBC32.RetCode SQLStatisticsW ( 451static internal extern /*SQLRETURN*/ODBC32.RetCode SQLTablesW (
fx\src\data\System\Data\Odbc\DbDataRecord.cs (3)
24internal ODBC32.SQL_TYPE? _dbtype; 33internal ODBC32.SQL_C _sqlctype; // need this to bind the value 34internal ODBC32.SQL_TYPE _sql_type; // need that to properly marshal the value
fx\src\data\System\Data\Odbc\Odbc32.cs (127)
31static internal Exception UnknownSQLType(ODBC32.SQL_TYPE sqltype) { 35return ADP.Argument(Res.GetString(Res.OdbcConnection_ConnectionStringTooLong, ODBC32.MAX_CONNECTION_STRING_LENGTH)); 90static internal Exception CantEnableConnectionpooling(ODBC32.RetCode retcode) { 91return ADP.DataAdapter(Res.GetString(Res.Odbc_CantEnableConnectionpooling, ODBC32.RetcodeToString(retcode))); 93static internal Exception CantAllocateEnvironmentHandle(ODBC32.RetCode retcode) { 94return ADP.DataAdapter(Res.GetString(Res.Odbc_CantAllocateEnvironmentHandle, ODBC32.RetcodeToString(retcode))); 96static internal Exception FailedToGetDescriptorHandle(ODBC32.RetCode retcode) { 97return ADP.DataAdapter(Res.GetString(Res.Odbc_FailedToGetDescriptorHandle, ODBC32.RetcodeToString(retcode))); 107static internal void TraceODBC(int level, string method, ODBC32.RetCode retcode) { 736Debug.Assert(retcode!=ODBC32.RetCode.INVALID_HANDLE, "retcode must never be ODBC32.RetCode.INVALID_HANDLE"); 776static private readonly TypeMap _BigInt = new TypeMap(OdbcType.BigInt, DbType.Int64, typeof(Int64), ODBC32.SQL_TYPE.BIGINT, ODBC32.SQL_C.SBIGINT, ODBC32.SQL_C.SBIGINT, 8, 20, true); 777static private readonly TypeMap _Binary = new TypeMap(OdbcType.Binary, DbType.Binary, typeof(byte[]), ODBC32.SQL_TYPE.BINARY, ODBC32.SQL_C.BINARY, ODBC32.SQL_C.BINARY, -1, -1, false); 778static private readonly TypeMap _Bit = new TypeMap(OdbcType.Bit, DbType.Boolean, typeof(Boolean), ODBC32.SQL_TYPE.BIT, ODBC32.SQL_C.BIT, ODBC32.SQL_C.BIT, 1, 1, false); 779static internal 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); 780static private readonly TypeMap _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); 781static private readonly TypeMap _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); 782static private readonly TypeMap _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); 783static private readonly TypeMap _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); 785static private readonly TypeMap _Double = new TypeMap(OdbcType.Double, DbType.Double, typeof(Double), ODBC32.SQL_TYPE.DOUBLE, ODBC32.SQL_C.DOUBLE, ODBC32.SQL_C.DOUBLE, 8, 15, false); 786static internal 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); 787static private readonly TypeMap _Int = new TypeMap(OdbcType.Int, DbType.Int32, typeof(Int32), ODBC32.SQL_TYPE.INTEGER, ODBC32.SQL_C.SLONG, ODBC32.SQL_C.SLONG, 4, 10, true); 788static private readonly TypeMap _NChar = new TypeMap(OdbcType.NChar, DbType.StringFixedLength, typeof(String), ODBC32.SQL_TYPE.WCHAR, ODBC32.SQL_C.WCHAR, ODBC32.SQL_C.WCHAR, -1, -1, false); 789static internal 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); 790static private readonly TypeMap _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); 791static internal 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); 792static private readonly TypeMap _Real = new TypeMap(OdbcType.Real, DbType.Single, typeof(Single), ODBC32.SQL_TYPE.REAL, ODBC32.SQL_C.REAL, ODBC32.SQL_C.REAL, 4, 7, false); 793static private readonly TypeMap _UniqueId = new TypeMap(OdbcType.UniqueIdentifier, DbType.Guid, typeof(Guid), ODBC32.SQL_TYPE.GUID, ODBC32.SQL_C.GUID, ODBC32.SQL_C.GUID, 16, 36, false); 794static private readonly TypeMap _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); 795static private readonly TypeMap _SmallInt = new TypeMap(OdbcType.SmallInt, DbType.Int16, typeof(Int16), ODBC32.SQL_TYPE.SMALLINT, ODBC32.SQL_C.SSHORT, ODBC32.SQL_C.SSHORT, 2, 5, true); 796static internal 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); 797static private readonly TypeMap _Timestamp = new TypeMap(OdbcType.Timestamp, DbType.Binary, typeof(Byte[]), ODBC32.SQL_TYPE.BINARY, ODBC32.SQL_C.BINARY, ODBC32.SQL_C.BINARY, -1, -1, false); 798static private readonly TypeMap _TinyInt = new TypeMap(OdbcType.TinyInt, DbType.Byte, typeof(Byte), ODBC32.SQL_TYPE.TINYINT, ODBC32.SQL_C.UTINYINT, ODBC32.SQL_C.UTINYINT, 1, 3, true); 799static private readonly TypeMap _VarBinary = new TypeMap(OdbcType.VarBinary, DbType.Binary, typeof(Byte[]), ODBC32.SQL_TYPE.VARBINARY, ODBC32.SQL_C.BINARY, ODBC32.SQL_C.BINARY, -1, -1, false); 800static internal 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); 801static private readonly TypeMap _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); 802static private readonly TypeMap _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); 803static private readonly TypeMap _XML = new TypeMap(OdbcType.Text, DbType.AnsiString, typeof(String), ODBC32.SQL_TYPE.LONGVARCHAR, ODBC32.SQL_C.WCHAR, ODBC32.SQL_C.CHAR, -1, -1, false); 809internal readonly ODBC32.SQL_TYPE _sql_type; 810internal readonly ODBC32.SQL_C _sql_c; 811internal readonly ODBC32.SQL_C _param_sql_c; 818private 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) { 936static internal TypeMap FromSqlType(ODBC32.SQL_TYPE sqltype) { 938case ODBC32.SQL_TYPE.CHAR: return _Char; 939case ODBC32.SQL_TYPE.VARCHAR: return _VarChar; 940case ODBC32.SQL_TYPE.LONGVARCHAR: return _Text; 941case ODBC32.SQL_TYPE.WCHAR: return _NChar; 942case ODBC32.SQL_TYPE.WVARCHAR: return _NVarChar; 943case ODBC32.SQL_TYPE.WLONGVARCHAR: return _NText; 944case ODBC32.SQL_TYPE.DECIMAL: return _Decimal; 945case ODBC32.SQL_TYPE.NUMERIC: return _Numeric; 946case ODBC32.SQL_TYPE.SMALLINT: return _SmallInt; 947case ODBC32.SQL_TYPE.INTEGER: return _Int; 948case ODBC32.SQL_TYPE.REAL: return _Real; 949case ODBC32.SQL_TYPE.FLOAT: return _Double; 950case ODBC32.SQL_TYPE.DOUBLE: return _Double; 951case ODBC32.SQL_TYPE.BIT: return _Bit; 952case ODBC32.SQL_TYPE.TINYINT: return _TinyInt; 953case ODBC32.SQL_TYPE.BIGINT: return _BigInt; 954case ODBC32.SQL_TYPE.BINARY: return _Binary; 955case ODBC32.SQL_TYPE.VARBINARY: return _VarBinary; 956case ODBC32.SQL_TYPE.LONGVARBINARY: return _Image; 957case ODBC32.SQL_TYPE.TYPE_DATE: return _Date; 958case ODBC32.SQL_TYPE.TYPE_TIME: return _Time; 959case ODBC32.SQL_TYPE.TIMESTAMP: 960case ODBC32.SQL_TYPE.TYPE_TIMESTAMP: return _DateTime; 961case ODBC32.SQL_TYPE.GUID: return _UniqueId; 962case ODBC32.SQL_TYPE.SS_VARIANT: return _Variant; 963case ODBC32.SQL_TYPE.SS_UDT: return _UDT; 964case ODBC32.SQL_TYPE.SS_XML: return _XML; 966case ODBC32.SQL_TYPE.SS_UTCDATETIME: 967case ODBC32.SQL_TYPE.SS_TIME_EX:
fx\src\data\System\Data\Odbc\OdbcCommand.cs (51)
82_cmdWrapper.FreeKeyInfoStatementHandle(ODBC32.STMT.CLOSE); 83_cmdWrapper.FreeStatementHandle(ODBC32.STMT.CLOSE); 362internal OdbcDescriptorHandle GetDescriptorHandle(ODBC32.SQL_ATTR attribute) { 397_cmdWrapper.FreeStatementHandle(ODBC32.STMT.RESET_PARAMS); 416ODBC32.RetCode retcode = stmt.Cancel(); 420case ODBC32.RetCode.SUCCESS: 421case ODBC32.RetCode.SUCCESS_WITH_INFO: 519ODBC32.SQL_API method){ 531return ExecuteReaderObject(behavior,method,needReader,null,ODBC32.SQL_API.SQLEXECDIRECT); 538ODBC32.SQL_API odbcApiMethod) { // MDAC 68324 550ODBC32.RetCode retcode; 571ODBC32.SQL_ATTR.QUERY_TIMEOUT, 587TrySetStatementAttribute(stmt, (ODBC32.SQL_ATTR)ODBC32.SQL_SOPT_SS.NOBROWSETABLE, (IntPtr)ODBC32.SQL_NB.ON); 588TrySetStatementAttribute(stmt, (ODBC32.SQL_ATTR)ODBC32.SQL_SOPT_SS.HIDDEN_COLUMNS, (IntPtr)ODBC32.SQL_HC.ON); 595TrySetStatementAttribute(stmt, (ODBC32.SQL_ATTR)ODBC32.SQL_SOPT_SS.NOBROWSETABLE, (IntPtr)ODBC32.SQL_NB.OFF); 596TrySetStatementAttribute(stmt, (ODBC32.SQL_ATTR)ODBC32.SQL_SOPT_SS.HIDDEN_COLUMNS, (IntPtr)ODBC32.SQL_HC.OFF); 610if(ODBC32.RetCode.SUCCESS != retcode) { 651if(retcode == ODBC32.RetCode.SUCCESS || retcode == ODBC32.RetCode.SUCCESS_WITH_INFO) { 656else if(retcode == ODBC32.RetCode.NO_DATA) { 666case ODBC32.SQL_API.SQLEXECDIRECT: 684case ODBC32.SQL_API.SQLTABLES: 691case ODBC32.SQL_API.SQLCOLUMNS: 698case ODBC32.SQL_API.SQLPROCEDURES: 704case ODBC32.SQL_API.SQLPROCEDURECOLUMNS: 711case ODBC32.SQL_API.SQLSTATISTICS: 719case ODBC32.SQL_API.SQLGETTYPEINFO: 730if((ODBC32.RetCode.SUCCESS != retcode) && (ODBC32.RetCode.NO_DATA != retcode)) { 801ODBC32.RetCode retcode; 821if (ODBC32.RetCode.SUCCESS != retcode) { 829void TrySetStatementAttribute (OdbcStatementHandle stmt, ODBC32.SQL_ATTR stmtAttribute, IntPtr value) { 831ODBC32.RetCode retcode = stmt.SetStatementAttribute( 834ODBC32.SQL_IS.UINTEGER); 836if (retcode == ODBC32.RetCode.ERROR) { 983internal void FreeStatementHandle(ODBC32.STMT stmt) { 989ODBC32.RetCode retcode; 1005internal void FreeKeyInfoStatementHandle(ODBC32.STMT stmt) { 1025internal OdbcDescriptorHandle GetDescriptorHandle(ODBC32.SQL_ATTR attribute) { 1039internal void StatementErrorHandler(ODBC32.RetCode retcode) { 1041case ODBC32.RetCode.SUCCESS: 1042case ODBC32.RetCode.SUCCESS_WITH_INFO: 1052FreeStatementHandle(ODBC32.STMT.UNBIND);
fx\src\data\System\Data\Odbc\OdbcCommandBuilder.cs (14)
178ODBC32.RetCode retcode = hstmt.ProcedureColumns(parts[1], parts[2], parts[3], null); 183if (ODBC32.RetCode.SUCCESS != retcode) { 202parameter.ParameterName = reader.GetString(ODBC32.COLUMN_NAME-1); 203switch ((ODBC32.SQL_PARAM)reader.GetInt16(ODBC32.COLUMN_TYPE-1)){ 204case ODBC32.SQL_PARAM.INPUT: 207case ODBC32.SQL_PARAM.OUTPUT: 211case ODBC32.SQL_PARAM.INPUT_OUTPUT: 214case ODBC32.SQL_PARAM.RETURN_VALUE: 221parameter.OdbcType = TypeMap.FromSqlType((ODBC32.SQL_TYPE)reader.GetInt16(ODBC32.DATA_TYPE-1))._odbcType; 222parameter.Size = (int)reader.GetInt32(ODBC32.COLUMN_SIZE-1); 226parameter.ScaleInternal = (Byte)reader.GetInt16(ODBC32.DECIMAL_DIGITS-1); 227parameter.PrecisionInternal = (Byte)reader.GetInt16(ODBC32.NUM_PREC_RADIX-1);
fx\src\data\System\Data\Odbc\OdbcConnection.cs (110)
105return GetConnectAttrString(ODBC32.SQL_ATTR.CURRENT_CATALOG); 124return GetInfoStringUnhandled(ODBC32.SQL_INFO.SERVER_NAME, true); 199ProviderInfo.DriverName = GetInfoStringUnhandled(ODBC32.SQL_INFO.DRIVER_NAME); 210ProviderInfo.DriverVersion = GetInfoStringUnhandled(ODBC32.SQL_INFO.DRIVER_ODBC_VER); 246escapeCharString = GetInfoStringUnhandled(ODBC32.SQL_INFO.SEARCH_PATTERN_ESCAPE); 257quoteCharString = GetInfoStringUnhandled(ODBC32.SQL_INFO.IDENTIFIER_QUOTE_CHAR); 276ConnectionHandle.CompleteTransaction(ODBC32.SQL_ROLLBACK); 300int isDead = GetConnectAttr(ODBC32.SQL_ATTR.CONNECTION_DEAD, ODBC32.HANDLER.IGNORE); 301if (ODBC32.SQL_CD_TRUE == isDead) { 349internal string GetConnectAttrString(ODBC32.SQL_ATTR attribute) { 355ODBC32.RetCode retcode = connectionHandle.GetConnectionAttribute(attribute, buffer, out cbActual); 362if ((ODBC32.RetCode.SUCCESS == retcode) || (ODBC32.RetCode.SUCCESS_WITH_INFO == retcode)) { 365else if (retcode == ODBC32.RetCode.ERROR) { 376internal int GetConnectAttr(ODBC32.SQL_ATTR attribute, ODBC32.HANDLER handler) { 382ODBC32.RetCode retcode = connectionHandle.GetConnectionAttribute(attribute, buffer, out cbActual); 384if ((ODBC32.RetCode.SUCCESS == retcode) || (ODBC32.RetCode.SUCCESS_WITH_INFO == retcode)) { 388if (retcode == ODBC32.RetCode.ERROR) { 394if (handler == ODBC32.HANDLER.THROW) { 409internal ODBC32.RetCode GetInfoInt16Unhandled(ODBC32.SQL_INFO info, out Int16 resultValue) { 411ODBC32.RetCode retcode = ConnectionHandle.GetInfo1(info, buffer); 416internal ODBC32.RetCode GetInfoInt32Unhandled(ODBC32.SQL_INFO info, out Int32 resultValue) { 418ODBC32.RetCode retcode = ConnectionHandle.GetInfo1(info, buffer); 423private Int32 GetInfoInt32Unhandled(ODBC32.SQL_INFO infotype) { 429internal string GetInfoStringUnhandled(ODBC32.SQL_INFO info) { 433private string GetInfoStringUnhandled(ODBC32.SQL_INFO info, bool handleError) { 440ODBC32.RetCode retcode = connectionHandle.GetInfo2(info, buffer, out cbActual); 447if (retcode == ODBC32.RetCode.SUCCESS || retcode == ODBC32.RetCode.SUCCESS_WITH_INFO) { 461internal Exception HandleErrorNoThrow(OdbcHandle hrHandle, ODBC32.RetCode retcode) { 463Debug.Assert(retcode!=ODBC32.RetCode.INVALID_HANDLE, "retcode must never be ODBC32.RetCode.INVALID_HANDLE"); 466case ODBC32.RetCode.SUCCESS: 468case ODBC32.RetCode.SUCCESS_WITH_INFO: { 472OdbcErrorCollection errors = ODBC32.GetDiagErrors(null, hrHandle, retcode); 479OdbcException e = OdbcException.CreateException(ODBC32.GetDiagErrors(null, hrHandle, retcode), retcode); 489internal void HandleError(OdbcHandle hrHandle, ODBC32.RetCode retcode) { 492case ODBC32.RetCode.SUCCESS: 493case ODBC32.RetCode.SUCCESS_WITH_INFO: 574internal void SetSupportedType (ODBC32.SQL_TYPE sqltype) { 575ODBC32.SQL_CVT sqlcvt; 578case ODBC32.SQL_TYPE.NUMERIC: { 579sqlcvt = ODBC32.SQL_CVT.NUMERIC; 582case ODBC32.SQL_TYPE.WCHAR: { 583sqlcvt = ODBC32.SQL_CVT.WCHAR; 586case ODBC32.SQL_TYPE.WVARCHAR: { 587sqlcvt = ODBC32.SQL_CVT.WVARCHAR; 590case ODBC32.SQL_TYPE.WLONGVARCHAR: { 591sqlcvt = ODBC32.SQL_CVT.WLONGVARCHAR; 602internal void FlagRestrictedSqlBindType(ODBC32.SQL_TYPE sqltype) { 603ODBC32.SQL_CVT sqlcvt; 606case ODBC32.SQL_TYPE.NUMERIC: { 607sqlcvt = ODBC32.SQL_CVT.NUMERIC; 610case ODBC32.SQL_TYPE.DECIMAL: { 611sqlcvt = ODBC32.SQL_CVT.DECIMAL; 621internal void FlagUnsupportedConnectAttr (ODBC32.SQL_ATTR Attribute) { 623case ODBC32.SQL_ATTR.CURRENT_CATALOG: 626case ODBC32.SQL_ATTR.CONNECTION_DEAD: 635internal void FlagUnsupportedStmtAttr (ODBC32.SQL_ATTR Attribute) { 637case ODBC32.SQL_ATTR.QUERY_TIMEOUT: 640case (ODBC32.SQL_ATTR)ODBC32.SQL_SOPT_SS.NOBROWSETABLE: 643case (ODBC32.SQL_ATTR)ODBC32.SQL_SOPT_SS.HIDDEN_COLUMNS: 652internal void FlagUnsupportedColAttr (ODBC32.SQL_DESC v3FieldId, ODBC32.SQL_COLUMN v2FieldId) { 655case (ODBC32.SQL_DESC)ODBC32.SQL_CA_SS.COLUMN_KEY: 674internal Boolean SQLGetFunctions(ODBC32.SQL_API odbcFunction) { 676ODBC32.RetCode retcode; 688if(retcode != ODBC32.RetCode.SUCCESS) 700internal bool TestTypeSupport (ODBC32.SQL_TYPE sqltype){ 701ODBC32.SQL_CONVERT sqlconvert; 702ODBC32.SQL_CVT sqlcvt; 707case ODBC32.SQL_TYPE.NUMERIC: { 708sqlconvert = ODBC32.SQL_CONVERT.NUMERIC; 709sqlcvt = ODBC32.SQL_CVT.NUMERIC; 712case ODBC32.SQL_TYPE.WCHAR: { 713sqlconvert = ODBC32.SQL_CONVERT.CHAR; 714sqlcvt = ODBC32.SQL_CVT.WCHAR; 717case ODBC32.SQL_TYPE.WVARCHAR: { 718sqlconvert = ODBC32.SQL_CONVERT.VARCHAR; 719sqlcvt = ODBC32.SQL_CVT.WVARCHAR; 722case ODBC32.SQL_TYPE.WLONGVARCHAR: { 723sqlconvert = ODBC32.SQL_CONVERT.LONGVARCHAR; 724sqlcvt = ODBC32.SQL_CVT.WLONGVARCHAR; 736flags = GetInfoInt32Unhandled((ODBC32.SQL_INFO)sqlconvert); 748internal bool TestRestrictedSqlBindType (ODBC32.SQL_TYPE sqltype){ 749ODBC32.SQL_CVT sqlcvt; 751case ODBC32.SQL_TYPE.NUMERIC: { 752sqlcvt = ODBC32.SQL_CVT.NUMERIC; 755case ODBC32.SQL_TYPE.DECIMAL: { 756sqlcvt = ODBC32.SQL_CVT.DECIMAL; 817ODBC32.RetCode retcode = connectionHandle.BeginTransaction(ref isolevel); 818if (retcode == ODBC32.RetCode.ERROR) { 842ODBC32.RetCode retcode = connectionHandle.SetConnectionAttribute3(ODBC32.SQL_ATTR.CURRENT_CATALOG, value, checked((Int32)value.Length*2)); 844if (retcode != ODBC32.RetCode.SUCCESS) { 859ODBC32.RetCode retcode; 861retcode = connectionHandle.SetConnectionAttribute2(ODBC32.SQL_ATTR.SQL_COPT_SS_ENLIST_IN_DTC, (IntPtr) ODBC32.SQL_DTC_DONE, ODBC32.SQL_IS_PTR); 864retcode = connectionHandle.SetConnectionAttribute4(ODBC32.SQL_ATTR.SQL_COPT_SS_ENLIST_IN_DTC, oleTxTransaction, ODBC32.SQL_IS_PTR); 867if (retcode != ODBC32.RetCode.SUCCESS) { 877return GetInfoStringUnhandled(ODBC32.SQL_INFO.DBMS_VER, true);
fx\src\data\System\Data\Odbc\OdbcConnectionFactory.cs (2)
76string stringValue = odbcOuterConnection.GetInfoStringUnhandled(ODBC32.SQL_INFO.DRIVER_NAME); 114String versionString = odbcOuterConnection.GetInfoStringUnhandled(ODBC32.SQL_INFO.DBMS_VER);
fx\src\data\System\Data\Odbc\OdbcConnectionHandle.cs (69)
36internal OdbcConnectionHandle(OdbcConnection connection, OdbcConnectionString constr, OdbcEnvironmentHandle environmentHandle) : base(ODBC32.SQL_HANDLE.DBC, environmentHandle) { 44ODBC32.RetCode retcode; 52retcode = SetConnectionAttribute2(ODBC32.SQL_ATTR.LOGIN_TIMEOUT, (IntPtr)connectionTimeout, (Int32)ODBC32.SQL_IS.UINTEGER); 64private ODBC32.RetCode AutoCommitOff() { 65ODBC32.RetCode retcode; 73retcode = UnsafeNativeMethods.SQLSetConnectAttrW(this, ODBC32.SQL_ATTR.AUTOCOMMIT, ODBC32.SQL_AUTOCOMMIT_OFF, (Int32)ODBC32.SQL_IS.UINTEGER); 75case ODBC32.RetCode.SUCCESS: 76case ODBC32.RetCode.SUCCESS_WITH_INFO: 85internal ODBC32.RetCode BeginTransaction(ref IsolationLevel isolevel) { 86ODBC32.RetCode retcode = ODBC32.RetCode.SUCCESS; 87ODBC32.SQL_ATTR isolationAttribute; 89ODBC32.SQL_TRANSACTION sql_iso; 92sql_iso = ODBC32.SQL_TRANSACTION.READ_UNCOMMITTED; 93isolationAttribute = ODBC32.SQL_ATTR.TXN_ISOLATION; 96sql_iso = ODBC32.SQL_TRANSACTION.READ_COMMITTED; 97isolationAttribute = ODBC32.SQL_ATTR.TXN_ISOLATION; 100sql_iso = ODBC32.SQL_TRANSACTION.REPEATABLE_READ; 101isolationAttribute = ODBC32.SQL_ATTR.TXN_ISOLATION; 104sql_iso = ODBC32.SQL_TRANSACTION.SERIALIZABLE; 105isolationAttribute = ODBC32.SQL_ATTR.TXN_ISOLATION; 108sql_iso = ODBC32.SQL_TRANSACTION.SNAPSHOT; 110isolationAttribute = ODBC32.SQL_ATTR.SQL_COPT_SS_TXN_ISOLATION; 119retcode = SetConnectionAttribute2(isolationAttribute, (IntPtr)sql_iso, (Int32)ODBC32.SQL_IS.INTEGER); 126if(ODBC32.RetCode.SUCCESS_WITH_INFO == retcode) { 132case ODBC32.RetCode.SUCCESS: 133case ODBC32.RetCode.SUCCESS_WITH_INFO: 142internal ODBC32.RetCode CompleteTransaction(short transactionOperation) { 147ODBC32.RetCode retcode = CompleteTransaction(transactionOperation, base.handle); 158private ODBC32.RetCode CompleteTransaction(short transactionOperation, IntPtr handle) { 161ODBC32.RetCode retcode = ODBC32.RetCode.SUCCESS; 168if((ODBC32.RetCode.SUCCESS == retcode) || (ODBC32.RetCode.SUCCESS_WITH_INFO == retcode)) { 175retcode = UnsafeNativeMethods.SQLSetConnectAttrW(handle, ODBC32.SQL_ATTR.AUTOCOMMIT, ODBC32.SQL_AUTOCOMMIT_ON, (Int32)ODBC32.SQL_IS.UINTEGER); 185private ODBC32.RetCode Connect(string connectionString) { 188ODBC32.RetCode retcode; 195retcode = UnsafeNativeMethods.SQLDriverConnectW(this, ADP.PtrZero, connectionString, ODBC32.SQL_NTS, ADP.PtrZero, 0, out cbActualSize, (short)ODBC32.SQL_DRIVER.NOPROMPT); 197case ODBC32.RetCode.SUCCESS: 198case ODBC32.RetCode.SUCCESS_WITH_INFO: 209ODBC32.RetCode retcode; 212retcode = CompleteTransaction(ODBC32.SQL_ROLLBACK, handle); 223internal ODBC32.RetCode GetConnectionAttribute(ODBC32.SQL_ATTR attribute, byte[] buffer, out int cbActual) { 224ODBC32.RetCode retcode = UnsafeNativeMethods.SQLGetConnectAttrW(this, attribute, buffer, buffer.Length, out cbActual); 229internal ODBC32.RetCode GetFunctions(ODBC32.SQL_API fFunction, out Int16 fExists) { 230ODBC32.RetCode retcode = UnsafeNativeMethods.SQLGetFunctions(this, fFunction, out fExists); 235internal ODBC32.RetCode GetInfo2(ODBC32.SQL_INFO info, byte[] buffer, out short cbActual) { 236ODBC32.RetCode retcode = UnsafeNativeMethods.SQLGetInfoW(this, info, buffer, checked((short)buffer.Length), out cbActual); 241internal ODBC32.RetCode GetInfo1(ODBC32.SQL_INFO info, byte[] buffer) { 242ODBC32.RetCode retcode = UnsafeNativeMethods.SQLGetInfoW(this, info, buffer, checked((short)buffer.Length), ADP.PtrZero); 247internal ODBC32.RetCode SetConnectionAttribute2(ODBC32.SQL_ATTR attribute, IntPtr value, Int32 length) { 248ODBC32.RetCode retcode = UnsafeNativeMethods.SQLSetConnectAttrW(this, attribute, value, length); 253internal ODBC32.RetCode SetConnectionAttribute3(ODBC32.SQL_ATTR attribute, string buffer, Int32 length) { 254ODBC32.RetCode retcode = UnsafeNativeMethods.SQLSetConnectAttrW(this, attribute, buffer, length); 259internal ODBC32.RetCode SetConnectionAttribute4(ODBC32.SQL_ATTR attribute, System.Transactions.IDtcTransaction transaction, Int32 length) { 260ODBC32.RetCode retcode = UnsafeNativeMethods.SQLSetConnectAttrW(this, attribute, transaction, length);
fx\src\data\System\Data\Odbc\OdbcConnectionString.cs (1)
38if ((null != connectionString) && (ODBC32.MAX_CONNECTION_STRING_LENGTH < connectionString.Length)) { // MDAC 83536
fx\src\data\System\Data\Odbc\OdbcDataReader.cs (245)
159ODBC32.RetCode retcode = this.FieldCountNoThrow(out cColsAffected); 160if(retcode != ODBC32.RetCode.SUCCESS) { 187internal ODBC32.RetCode FieldCountNoThrow(out Int16 cColsAffected) { 190return ODBC32.RetCode.ERROR; 193ODBC32.RetCode retcode = StatementHandle.NumberOfResultColumns(out cColsAffected); 194if (retcode == ODBC32.RetCode.SUCCESS) { 202SQLLEN isHidden = GetColAttribute(i, (ODBC32.SQL_DESC)ODBC32.SQL_CA_SS.COLUMN_HIDDEN, (ODBC32.SQL_COLUMN)(-1), ODBC32.HANDLER.IGNORE); 228ODBC32.RetCode retcode = StatementHandle.RowCount(out cRowsAffected); 229if (ODBC32.RetCode.SUCCESS == retcode || ODBC32.RetCode.SUCCESS_WITH_INFO == retcode) { 292wrapper.FreeStatementHandle(ODBC32.STMT.CLOSE); 296wrapper.FreeKeyInfoStatementHandle(ODBC32.STMT.CLOSE); 347info._typename = GetColAttributeStr(i, ODBC32.SQL_DESC.TYPE_NAME, ODBC32.SQL_COLUMN.TYPE_NAME, ODBC32.HANDLER.THROW); 373info._name = GetColAttributeStr(i, ODBC32.SQL_DESC.NAME, ODBC32.SQL_COLUMN.NAME, ODBC32.HANDLER.THROW); 410case ODBC32.SQL_TYPE.CHAR: 411case ODBC32.SQL_TYPE.VARCHAR: 412case ODBC32.SQL_TYPE.LONGVARCHAR: 413case ODBC32.SQL_TYPE.WCHAR: 414case ODBC32.SQL_TYPE.WVARCHAR: 415case ODBC32.SQL_TYPE.WLONGVARCHAR: 418case ODBC32.SQL_TYPE.DECIMAL: 419case ODBC32.SQL_TYPE.NUMERIC: 422case ODBC32.SQL_TYPE.SMALLINT: 425case ODBC32.SQL_TYPE.INTEGER: 428case ODBC32.SQL_TYPE.REAL: 431case ODBC32.SQL_TYPE.FLOAT: 432case ODBC32.SQL_TYPE.DOUBLE: 435case ODBC32.SQL_TYPE.BIT: 438case ODBC32.SQL_TYPE.TINYINT: 441case ODBC32.SQL_TYPE.BIGINT: 444case ODBC32.SQL_TYPE.BINARY: 445case ODBC32.SQL_TYPE.VARBINARY: 446case ODBC32.SQL_TYPE.LONGVARBINARY: 449case ODBC32.SQL_TYPE.TYPE_DATE: 452case ODBC32.SQL_TYPE.TYPE_TIME: 456case ODBC32.SQL_TYPE.TYPE_TIMESTAMP: 459case ODBC32.SQL_TYPE.GUID: 462case ODBC32.SQL_TYPE.SS_VARIANT: 472bool isNotDbNull = QueryFieldInfo(i, ODBC32.SQL_C.BINARY, out dummy); 476ODBC32.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); 519info._dbtype = unchecked((ODBC32.SQL_TYPE)(int)GetColAttribute(i, ODBC32.SQL_DESC.CONCISE_TYPE, ODBC32.SQL_COLUMN.TYPE,ODBC32.HANDLER.THROW)); 522bool sign = (GetColAttribute(i, ODBC32.SQL_DESC.UNSIGNED, ODBC32.SQL_COLUMN.UNSIGNED, ODBC32.HANDLER.THROW).ToInt64() != 0); 594if (GetData(i, ODBC32.SQL_C.UTINYINT)) { 609if (GetData(i, ODBC32.SQL_C.WCHAR)) { 624if (GetData(i, ODBC32.SQL_C.SSHORT)) { 639if(GetData(i, ODBC32.SQL_C.SLONG)){ 661if (GetData(i, ODBC32.SQL_C.WCHAR)) { 662string value = (string)Buffer.MarshalToManaged(0, ODBC32.SQL_C.WCHAR, ODBC32.SQL_NTS); 677if(GetData(i, ODBC32.SQL_C.BIT)){ 678this.dataCache[i] = Buffer.MarshalToManaged(0, ODBC32.SQL_C.BIT, -1); 692if(GetData(i, ODBC32.SQL_C.REAL)){ 708if(GetData(i, ODBC32.SQL_C.TYPE_DATE)){ 709this.dataCache[i] = Buffer.MarshalToManaged(0, ODBC32.SQL_C.TYPE_DATE, -1); 724if(GetData(i, ODBC32.SQL_C.TYPE_TIMESTAMP)){ 725this.dataCache[i] = Buffer.MarshalToManaged(0, ODBC32.SQL_C.TYPE_TIMESTAMP, -1); 747if(GetData(i, ODBC32.SQL_C.WCHAR )){ 750s = (string)Buffer.MarshalToManaged(0, ODBC32.SQL_C.WCHAR, ODBC32.SQL_NTS); 770if(GetData(i, ODBC32.SQL_C.DOUBLE)){ 786if(GetData(i, ODBC32.SQL_C.GUID)){ 821if (GetData(i, ODBC32.SQL_C.WCHAR, buffer.Length - 2, out lengthOrIndicator)) { 825Debug.Assert(lengthOrIndicator >= 0 || lengthOrIndicator == ODBC32.SQL_NO_TOTAL, "unexpected lengthOrIndicator value"); 827if (lengthOrIndicator <= cbMaxData && (ODBC32.SQL_NO_TOTAL != lengthOrIndicator)) { 844int cbBuilderInitialCapacity = (lengthOrIndicator == ODBC32.SQL_NO_TOTAL) ? cbMaxData : lengthOrIndicator; 850int cbMissing = (ODBC32.SQL_NO_TOTAL == lengthOrIndicator) ? -1 : lengthOrIndicator - cbActual; 861gotData = GetData(i, ODBC32.SQL_C.WCHAR, buffer.Length - 2, out lengthOrIndicator); 865Debug.Assert(lengthOrIndicator >= 0 || lengthOrIndicator == ODBC32.SQL_NO_TOTAL, "unexpected lengthOrIndicator value"); 867if (ODBC32.SQL_NO_TOTAL != lengthOrIndicator) { 898if(GetData(i, ODBC32.SQL_C.TYPE_TIME)){ 899this.dataCache[i] = Buffer.MarshalToManaged(0, ODBC32.SQL_C.TYPE_TIME, -1); 1044ODBC32.SQL_C sqlctype; 1048sqlctype = isCharsBuffer ? ODBC32.SQL_C.WCHAR : ODBC32.SQL_C.BINARY; 1143bool isDbNull = !QueryFieldInfo(i, ODBC32.SQL_C.WCHAR, out cbLengthOrIndicator); 1195isNotDbNull = GetData(i, ODBC32.SQL_C.WCHAR, cbReadMax + 2, out cbTotal); 1202isNotDbNull = GetData(i, ODBC32.SQL_C.BINARY, cbReadMax, out cbTotal); 1222else if (ODBC32.SQL_NO_TOTAL == cbTotal) 1287if(GetData(i, ODBC32.SQL_C.BINARY, cbBufferLen, out cbActual)) { 1290if(ODBC32.SQL_NO_TOTAL != cbActual) { 1300bool flag = GetData(i, ODBC32.SQL_C.BINARY, cbBufferLen, out cbActual); 1312junkSize = (ODBC32.SQL_NO_TOTAL != cbActual) ? cbActual : cbBufferLen; 1318while ((ODBC32.SQL_NO_TOTAL == cbActual) && GetData(i, ODBC32.SQL_C.BINARY, cbBufferLen, out cbActual)); 1343private SQLLEN GetColAttribute(int iColumn, ODBC32.SQL_DESC v3FieldId, ODBC32.SQL_COLUMN v2FieldId, ODBC32.HANDLER handler) { 1346ODBC32.RetCode retcode; 1358else if (v2FieldId != (ODBC32.SQL_COLUMN)(-1)) { 1364if (retcode != ODBC32.RetCode.SUCCESS) 1366if (retcode == ODBC32.RetCode.ERROR) { 1371if(handler == ODBC32.HANDLER.THROW) { 1388private String GetColAttributeStr(int i, ODBC32.SQL_DESC v3FieldId, ODBC32.SQL_COLUMN v2FieldId, ODBC32.HANDLER handler) { 1389ODBC32.RetCode retcode; 1405else if (v2FieldId != (ODBC32.SQL_COLUMN)(-1)) { 1411if((retcode != ODBC32.RetCode.SUCCESS) || (cchNameLength == 0)) 1413if (retcode == ODBC32.RetCode.ERROR) { 1418if(handler == ODBC32.HANDLER.THROW) { 1430private String GetDescFieldStr(int i, ODBC32.SQL_DESC attribute, ODBC32.HANDLER handler) { 1444ODBC32.RetCode retcode; 1448using(OdbcDescriptorHandle hdesc = new OdbcDescriptorHandle(StatementHandle, ODBC32.SQL_ATTR.APP_PARAM_DESC)) { 1455if((retcode != ODBC32.RetCode.SUCCESS) || (numericAttribute == 0)) 1457if (retcode == ODBC32.RetCode.ERROR) { 1459Connection.FlagUnsupportedColAttr(attribute, (ODBC32.SQL_COLUMN)0); 1462if(handler == ODBC32.HANDLER.THROW) { 1477private bool QueryFieldInfo(int i, ODBC32.SQL_C sqlctype, out int cbLengthOrIndicator) { 1479if (sqlctype == ODBC32.SQL_C.WCHAR) { 1486private bool GetData(int i, ODBC32.SQL_C sqlctype) { 1506private bool GetData(int i, ODBC32.SQL_C sqlctype, int cb, out int cbLengthOrIndicator) { 1524ODBC32.RetCode retcode = StatementHandle.GetData( 1532case ODBC32.RetCode.SUCCESS: 1534case ODBC32.RetCode.SUCCESS_WITH_INFO: 1535if ((Int32)cbActual == ODBC32.SQL_NO_TOTAL) { 1541case ODBC32.RetCode.NO_DATA: 1549if (sqlctype != ODBC32.SQL_C.WCHAR && sqlctype != ODBC32.SQL_C.BINARY) { 1553if (cbActual == (IntPtr)ODBC32.SQL_NO_TOTAL) { 1568if (cbActual == (IntPtr)ODBC32.SQL_NULL_DATA) { 1608ODBC32.RetCode retcode; 1618case ODBC32.RetCode.SUCCESS_WITH_INFO: 1623case ODBC32.RetCode.SUCCESS: 1627case ODBC32.RetCode.NO_DATA: 1661ODBC32.RetCode retcode = FieldCountNoThrow(out cCols); 1662if ((retcode == ODBC32.RetCode.SUCCESS) && (cCols == 0)) { 1683ODBC32.RetCode retcode, firstRetCode = ODBC32.RetCode.SUCCESS; 1710hasMoreResults = ((retcode == ODBC32.RetCode.SUCCESS) 1711||(retcode == ODBC32.RetCode.SUCCESS_WITH_INFO)); 1713if (retcode == ODBC32.RetCode.SUCCESS_WITH_INFO) { 1716else if (!disposing && (retcode != ODBC32.RetCode.NO_DATA) && (ODBC32.RetCode.SUCCESS != retcode)) { 1722ODBC32.GetDiagErrors(errors, null, StatementHandle, retcode); 1738|| ((ODBC32.RetCode.NO_DATA != retcode) && allresults && (loop < MaxConsecutiveFailure)) // or process all results until done 1744if(retcode == ODBC32.RetCode.NO_DATA) { 1765ODBC32.SQL_NULLABILITY nullable; 1785typeMap = TypeMap.FromSqlType((ODBC32.SQL_TYPE)unchecked((int) GetColAttribute(i, ODBC32.SQL_DESC.CONCISE_TYPE, ODBC32.SQL_COLUMN.TYPE, ODBC32.HANDLER.THROW))); 1787bool sign = (GetColAttribute(i, ODBC32.SQL_DESC.UNSIGNED, ODBC32.SQL_COLUMN.UNSIGNED, ODBC32.HANDLER.THROW).ToInt64() != 0); 1793metaInfos[i].size = GetColAttribute(i, ODBC32.SQL_DESC.OCTET_LENGTH, ODBC32.SQL_COLUMN.LENGTH, ODBC32.HANDLER.IGNORE); 1798case ODBC32.SQL_TYPE.WCHAR: 1799case ODBC32.SQL_TYPE.WLONGVARCHAR: 1800case ODBC32.SQL_TYPE.WVARCHAR: 1805metaInfos[i].precision = (byte) GetColAttribute(i, (ODBC32.SQL_DESC)ODBC32.SQL_COLUMN.PRECISION, ODBC32.SQL_COLUMN.PRECISION, ODBC32.HANDLER.IGNORE); 1806metaInfos[i].scale = (byte) GetColAttribute(i, (ODBC32.SQL_DESC)ODBC32.SQL_COLUMN.SCALE, ODBC32.SQL_COLUMN.SCALE, ODBC32.HANDLER.IGNORE); 1808metaInfos[i].isAutoIncrement = GetColAttribute(i, ODBC32.SQL_DESC.AUTO_UNIQUE_VALUE, ODBC32.SQL_COLUMN.AUTO_INCREMENT, ODBC32.HANDLER.IGNORE) == 1; 1809metaInfos[i].isReadOnly = (GetColAttribute(i, ODBC32.SQL_DESC.UPDATABLE, ODBC32.SQL_COLUMN.UPDATABLE, ODBC32.HANDLER.IGNORE) == (Int32)ODBC32.SQL_UPDATABLE.READONLY); 1811nullable = (ODBC32.SQL_NULLABILITY) (int) GetColAttribute(i, ODBC32.SQL_DESC.NULLABLE, ODBC32.SQL_COLUMN.NULLABLE, ODBC32.HANDLER.IGNORE); 1812metaInfos[i].isNullable = (nullable == ODBC32.SQL_NULLABILITY.NULLABLE); 1815case ODBC32.SQL_TYPE.LONGVARCHAR: 1816case ODBC32.SQL_TYPE.WLONGVARCHAR: 1817case ODBC32.SQL_TYPE.LONGVARBINARY: 1831isKeyColumn = GetColAttribute(i, (ODBC32.SQL_DESC)ODBC32.SQL_CA_SS.COLUMN_KEY, (ODBC32.SQL_COLUMN)(-1), ODBC32.HANDLER.IGNORE) == 1; 1840metaInfos[i].baseSchemaName = GetColAttributeStr(i, ODBC32.SQL_DESC.SCHEMA_NAME, ODBC32.SQL_COLUMN.OWNER_NAME, ODBC32.HANDLER.IGNORE); 1841metaInfos[i].baseCatalogName = GetColAttributeStr(i, ODBC32.SQL_DESC.CATALOG_NAME, (ODBC32.SQL_COLUMN)(-1), ODBC32.HANDLER.IGNORE); 1842metaInfos[i].baseTableName = GetColAttributeStr(i, ODBC32.SQL_DESC.BASE_TABLE_NAME, ODBC32.SQL_COLUMN.TABLE_NAME, ODBC32.HANDLER.IGNORE); 1843metaInfos[i].baseColumnName = GetColAttributeStr(i, ODBC32.SQL_DESC.BASE_COLUMN_NAME, ODBC32.SQL_COLUMN.NAME, ODBC32.HANDLER.IGNORE); 1849metaInfos[i].baseTableName = GetDescFieldStr(i, ODBC32.SQL_DESC.BASE_TABLE_NAME, ODBC32.HANDLER.IGNORE); 1854metaInfos[i].baseColumnName = GetDescFieldStr(i, ODBC32.SQL_DESC.BASE_COLUMN_NAME, ODBC32.HANDLER.IGNORE); 1864if (nullable == ODBC32.SQL_NULLABILITY.UNKNOWN) 1874isKeyColumn = GetColAttribute(i, (ODBC32.SQL_DESC)ODBC32.SQL_CA_SS.COLUMN_KEY, (ODBC32.SQL_COLUMN)(-1), ODBC32.HANDLER.IGNORE) == 1; 1876isHidden = GetColAttribute(i, (ODBC32.SQL_DESC)ODBC32.SQL_CA_SS.COLUMN_HIDDEN, (ODBC32.SQL_COLUMN)(-1), ODBC32.HANDLER.IGNORE) == 1; 2035ODBC32.RetCode retcode; 2062if ((retcode == ODBC32.RetCode.SUCCESS) || (retcode == ODBC32.RetCode.SUCCESS_WITH_INFO)) { 2068(short)(ODBC32.SQL_PRIMARYKEYS.COLUMNNAME), // Column Number 2069ODBC32.SQL_C.WCHAR, 2073while (ODBC32.RetCode.SUCCESS == (retcode = KeyInfoStatementHandle.Fetch())) { 2110(short)(ODBC32.SQL_PRIMARYKEYS.COLUMNNAME), // SQLUSMALLINT ColumnNumber 2111ODBC32.SQL_C.WCHAR, // SQLSMALLINT TargetType 2132if ((retcode == ODBC32.RetCode.SUCCESS) || (retcode == ODBC32.RetCode.SUCCESS_WITH_INFO)) { 2137(short)(ODBC32.SQL_SPECIALCOLUMNSET.COLUMN_NAME), 2138ODBC32.SQL_C.WCHAR, 2143while (ODBC32.RetCode.SUCCESS == (retcode = KeyInfoStatementHandle.Fetch())) { 2156(short)(ODBC32.SQL_SPECIALCOLUMNSET.COLUMN_NAME), 2157ODBC32.SQL_C.WCHAR, 2182ODBC32.RetCode retcode; 2207if (retcode != ODBC32.RetCode.SUCCESS) { 2237(short)(ODBC32.SQL_STATISTICS.INDEXNAME), 2238ODBC32.SQL_C.WCHAR, 2243(short)(ODBC32.SQL_STATISTICS.ORDINAL_POSITION), 2244ODBC32.SQL_C.SSHORT, 2250(short)(ODBC32.SQL_STATISTICS.COLUMN_NAME), 2251ODBC32.SQL_C.WCHAR, 2257while (ODBC32.RetCode.SUCCESS == (retcode = KeyInfoStatementHandle.Fetch())) { 2343_cmdWrapper.FreeKeyInfoStatementHandle(ODBC32.STMT.UNBIND);
fx\src\data\System\Data\Odbc\OdbcEnvironmentHandle.cs (10)
30internal OdbcEnvironmentHandle() : base(ODBC32.SQL_HANDLE.ENV, null) { 31ODBC32.RetCode retcode; 37ODBC32.SQL_ATTR.ODBC_VERSION, 38ODBC32.SQL_OV_ODBC3, 39ODBC32.SQL_IS.INTEGER); 49ODBC32.SQL_ATTR.CONNECTION_POOLING, 50ODBC32.SQL_CP_ONE_PER_HENV, 51ODBC32.SQL_IS.INTEGER); 54case ODBC32.RetCode.SUCCESS: 55case ODBC32.RetCode.SUCCESS_WITH_INFO:
fx\src\data\System\Data\Odbc\OdbcException.cs (6)
25ODBC32.RETCODE _retcode; // DO NOT REMOVE! only needed for serialization purposes, because Everett had it. 27static internal OdbcException CreateException(OdbcErrorCollection errors, ODBC32.RetCode retcode) { 34builder.Append(Res.GetString(Res.Odbc_ExceptionMessage, ODBC32.RetcodeToString(retcode), error.SQLState, error.Message)); // MDAC 68337 47_retcode = (ODBC32.RETCODE) si.GetValue("odbcRetcode", typeof(ODBC32.RETCODE)); 64si.AddValue("odbcRetcode", _retcode, typeof(ODBC32.RETCODE));
fx\src\data\System\Data\Odbc\OdbcHandle.cs (41)
28private ODBC32.SQL_HANDLE _handleType; 31protected OdbcHandle(ODBC32.SQL_HANDLE handleType, OdbcHandle parentHandle) : base(IntPtr.Zero, true) { 36ODBC32.RetCode retcode = ODBC32.RetCode.SUCCESS; 43case ODBC32.SQL_HANDLE.ENV: 47case ODBC32.SQL_HANDLE.DBC: 48case ODBC32.SQL_HANDLE.STMT: 64case ODBC32.SQL_HANDLE.DBC: 65case ODBC32.SQL_HANDLE.STMT: 81if((ADP.PtrZero == base.handle) || (ODBC32.RetCode.SUCCESS != retcode)) { 87internal OdbcHandle(OdbcStatementHandle parentHandle, ODBC32.SQL_ATTR attribute) : base(IntPtr.Zero, true) { 88Debug.Assert((ODBC32.SQL_ATTR.APP_PARAM_DESC == attribute) || (ODBC32.SQL_ATTR.APP_ROW_DESC == attribute), "invalid attribute"); 89_handleType = ODBC32.SQL_HANDLE.DESC; 92ODBC32.RetCode retcode; 120internal ODBC32.SQL_HANDLE HandleType { 139ODBC32.SQL_HANDLE handleType = HandleType; 142case ODBC32.SQL_HANDLE.DBC: 144case ODBC32.SQL_HANDLE.ENV: 145case ODBC32.SQL_HANDLE.STMT: 146ODBC32.RetCode retcode = UnsafeNativeMethods.SQLFreeHandle(handleType, handle); 150case ODBC32.SQL_HANDLE.DESC: 172internal ODBC32.RetCode GetDiagnosticField (out string sqlState) { 176ODBC32.RetCode retcode = UnsafeNativeMethods.SQLGetDiagFieldW( 180ODBC32.SQL_DIAG_SQLSTATE, 185if ((retcode == ODBC32.RetCode.SUCCESS) || (retcode == ODBC32.RetCode.SUCCESS_WITH_INFO)) { 194internal ODBC32.RetCode GetDiagnosticRecord(short record, out string sqlState, StringBuilder message, out int nativeError, out short cchActual) { 197ODBC32.RetCode retcode = UnsafeNativeMethods.SQLGetDiagRecW(HandleType, this, record, sb, out nativeError, message, checked((short)message.Capacity), out cchActual); 200if ((retcode == ODBC32.RetCode.SUCCESS) || (retcode == ODBC32.RetCode.SUCCESS_WITH_INFO)) { 212internal OdbcDescriptorHandle(OdbcStatementHandle statementHandle, ODBC32.SQL_ATTR attribute) : base(statementHandle, attribute) { 215internal ODBC32.RetCode GetDescriptionField(int i, ODBC32.SQL_DESC attribute, CNativeBuffer buffer, out int numericAttribute) { 216ODBC32.RetCode retcode = UnsafeNativeMethods.SQLGetDescFieldW(this, checked((short)i), attribute, buffer, buffer.ShortLength, out numericAttribute); 221internal ODBC32.RetCode SetDescriptionField1(short ordinal, ODBC32.SQL_DESC type, IntPtr value) { 222ODBC32.RetCode retcode = UnsafeNativeMethods.SQLSetDescFieldW(this, ordinal, type, value, 0); 227internal ODBC32.RetCode SetDescriptionField2(short ordinal, ODBC32.SQL_DESC type, HandleRef value) { 228ODBC32.RetCode retcode = UnsafeNativeMethods.SQLSetDescFieldW(this, ordinal, type, value, 0);
fx\src\data\System\Data\Odbc\odbcmetadatafactory.cs (100)
28internal SchemaFunctionName(string schemaName, ODBC32.SQL_API odbcFunction) { 33internal readonly ODBC32.SQL_API _odbcFunction; 54new SchemaFunctionName(DbMetaDataCollectionNames.DataTypes,ODBC32.SQL_API.SQLGETTYPEINFO), 55new SchemaFunctionName(OdbcMetaDataCollectionNames.Columns,ODBC32.SQL_API.SQLCOLUMNS), 56new SchemaFunctionName(OdbcMetaDataCollectionNames.Indexes,ODBC32.SQL_API.SQLSTATISTICS), 57new SchemaFunctionName(OdbcMetaDataCollectionNames.Procedures,ODBC32.SQL_API.SQLPROCEDURES), 58new SchemaFunctionName(OdbcMetaDataCollectionNames.ProcedureColumns,ODBC32.SQL_API.SQLPROCEDURECOLUMNS), 59new SchemaFunctionName(OdbcMetaDataCollectionNames.ProcedureParameters,ODBC32.SQL_API.SQLPROCEDURECOLUMNS), 60new SchemaFunctionName(OdbcMetaDataCollectionNames.Tables,ODBC32.SQL_API.SQLTABLES), 61new SchemaFunctionName(OdbcMetaDataCollectionNames.Views,ODBC32.SQL_API.SQLTABLES)}; 242ODBC32.SQL_TYPE sqlType; 247sqlType = (ODBC32.SQL_TYPE)(Int32) Convert.ChangeType(getTypeInfoValues[indexDATA_TYPE], 254sqlType = ODBC32.SQL_TYPE.TYPE_DATE; 257sqlType = ODBC32.SQL_TYPE.TYPE_TIME; 280case ODBC32.SQL_TYPE.LONGVARCHAR: 281case ODBC32.SQL_TYPE.WLONGVARCHAR: 282case ODBC32.SQL_TYPE.LONGVARBINARY: 283case ODBC32.SQL_TYPE.SS_XML: 288case ODBC32.SQL_TYPE.VARCHAR: 289case ODBC32.SQL_TYPE.WVARCHAR: 290case ODBC32.SQL_TYPE.VARBINARY: 295case ODBC32.SQL_TYPE.CHAR: 296case ODBC32.SQL_TYPE.WCHAR: 297case ODBC32.SQL_TYPE.DECIMAL: 298case ODBC32.SQL_TYPE.NUMERIC: 299case ODBC32.SQL_TYPE.SMALLINT: 300case ODBC32.SQL_TYPE.INTEGER: 301case ODBC32.SQL_TYPE.REAL: 302case ODBC32.SQL_TYPE.FLOAT: 303case ODBC32.SQL_TYPE.DOUBLE: 304case ODBC32.SQL_TYPE.BIT: 305case ODBC32.SQL_TYPE.TINYINT: 306case ODBC32.SQL_TYPE.BIGINT: 307case ODBC32.SQL_TYPE.TYPE_DATE: 308case ODBC32.SQL_TYPE.TYPE_TIME: 309case ODBC32.SQL_TYPE.TIMESTAMP: 310case ODBC32.SQL_TYPE.TYPE_TIMESTAMP: 311case ODBC32.SQL_TYPE.GUID: 312case ODBC32.SQL_TYPE.SS_VARIANT: 313case ODBC32.SQL_TYPE.SS_UTCDATETIME: 314case ODBC32.SQL_TYPE.SS_TIME_EX: 315case ODBC32.SQL_TYPE.BINARY: 320case ODBC32.SQL_TYPE.SS_UDT: 346switch ((ODBC32.SQL_NULLABILITY)Convert.ToInt16(getTypeInfoValues[indexNULLABLE], null)) { 348case ODBC32.SQL_NULLABILITY.NO_NULLS: 352case ODBC32.SQL_NULLABILITY.NULLABLE: 356case ODBC32.SQL_NULLABILITY.UNKNOWN: 368case (Int16)ODBC32.SQL_SEARCHABLE.UNSEARCHABLE: 373case (Int16)ODBC32.SQL_SEARCHABLE.LIKE_ONLY: 378case (Int16)ODBC32.SQL_SEARCHABLE.ALL_EXCEPT_LIKE: 383case (Int16)ODBC32.SQL_SEARCHABLE.SEARCHABLE: 448if ((((short)values[positionOfColumnType] == ODBC32.SQL_RESULT_COL) && (isColumn == true)) || 449(((short)values[positionOfColumnType] != ODBC32.SQL_RESULT_COL) && (isColumn == false))) { 518dataReader = command.ExecuteReaderFromSQLMethod(allRestrictions, ODBC32.SQL_API.SQLCOLUMNS); 560ODBC32.RetCode retcode; 563stringValue = connection.GetInfoStringUnhandled(ODBC32.SQL_INFO.CATALOG_NAME_SEPARATOR); 571stringValue = connection.GetInfoStringUnhandled(ODBC32.SQL_INFO.DBMS_NAME); 592retcode = connection.GetInfoInt32Unhandled(ODBC32.SQL_INFO.SQL_OJ_CAPABILITIES_30,out int32Value); 595retcode = connection.GetInfoInt32Unhandled(ODBC32.SQL_INFO.SQL_OJ_CAPABILITIES_20, out int32Value); 598if ((retcode == ODBC32.RetCode.SUCCESS) || (retcode == ODBC32.RetCode.SUCCESS_WITH_INFO)){ 601if ((int32Value & (Int32)ODBC32.SQL_OJ_CAPABILITIES.LEFT) != 0){ 604if ((int32Value & (Int32)ODBC32.SQL_OJ_CAPABILITIES.RIGHT) != 0){ 607if ((int32Value & (Int32)ODBC32.SQL_OJ_CAPABILITIES.FULL) != 0){ 610if ((int32Value & (Int32)ODBC32.SQL_OJ_CAPABILITIES.INNER) != 0){ 618retcode = connection.GetInfoInt16Unhandled(ODBC32.SQL_INFO.GROUP_BY, out int16Value); 621if ((retcode == ODBC32.RetCode.SUCCESS) || (retcode == ODBC32.RetCode.SUCCESS_WITH_INFO)){ 625case (Int16)ODBC32.SQL_GROUP_BY.NOT_SUPPORTED: 629case (Int16)ODBC32.SQL_GROUP_BY.GROUP_BY_EQUALS_SELECT: 633case (Int16)ODBC32.SQL_GROUP_BY.GROUP_BY_CONTAINS_SELECT: 637case (Int16)ODBC32.SQL_GROUP_BY.NO_RELATION: 651retcode = connection.GetInfoInt16Unhandled(ODBC32.SQL_INFO.IDENTIFIER_CASE, out int16Value); 654if ((retcode == ODBC32.RetCode.SUCCESS) || (retcode == ODBC32.RetCode.SUCCESS_WITH_INFO)){ 658case (Int16)ODBC32.SQL_IDENTIFIER_CASE.SENSITIVE: 662case (Int16)ODBC32.SQL_IDENTIFIER_CASE.UPPER: 663case (Int16)ODBC32.SQL_IDENTIFIER_CASE.LOWER: 664case (Int16)ODBC32.SQL_IDENTIFIER_CASE.MIXED: 673stringValue = connection.GetInfoStringUnhandled(ODBC32.SQL_INFO.ORDER_BY_COLUMNS_IN_SELECT); 715retcode = connection.GetInfoInt16Unhandled(ODBC32.SQL_INFO.QUOTED_IDENTIFIER_CASE, out int16Value); 718if ((retcode == ODBC32.RetCode.SUCCESS) || (retcode == ODBC32.RetCode.SUCCESS_WITH_INFO)){ 722case (Int16)ODBC32.SQL_IDENTIFIER_CASE.SENSITIVE: 726case (Int16)ODBC32.SQL_IDENTIFIER_CASE.UPPER: 727case (Int16)ODBC32.SQL_IDENTIFIER_CASE.LOWER: 728case (Int16)ODBC32.SQL_IDENTIFIER_CASE.MIXED: 762allArguments[0] = ODBC32.SQL_ALL_TYPES; 768dataReader = command.ExecuteReaderFromSQLMethod(allArguments, ODBC32.SQL_API.SQLGETTYPEINFO); 804allRestrictions[3] = (Int16)ODBC32.SQL_INDEX.ALL; 805allRestrictions[4] = (Int16)ODBC32.SQL_STATISTICS_RESERVED.ENSURE; 807dataReader = command.ExecuteReaderFromSQLMethod(allRestrictions, ODBC32.SQL_API.SQLSTATISTICS); 845dataReader = command.ExecuteReaderFromSQLMethod(allRestrictions,ODBC32.SQL_API.SQLPROCEDURECOLUMNS); 884dataReader = command.ExecuteReaderFromSQLMethod(allRestrictions,ODBC32.SQL_API.SQLPROCEDURES); 893procedureType = (Int16)ODBC32.SQL_PROCEDURETYPE.UNKNOWN; 897procedureType = (Int16)ODBC32.SQL_PROCEDURETYPE.PROCEDURE; 901procedureType = (Int16)ODBC32.SQL_PROCEDURETYPE.FUNCTION; 944string keywords = connection.GetInfoStringUnhandled(ODBC32.SQL_INFO.KEYWORDS); 987dataReader = command.ExecuteReaderFromSQLMethod(allArguments, ODBC32.SQL_API.SQLTABLES); 1007if (rowIndexType == (Int16)ODBC32.SQL_STATISTICSTYPE.TABLE_STAT) {
fx\src\data\System\Data\Odbc\OdbcParameter.cs (69)
57private ODBC32.SQL_C _boundSqlCType; 58private ODBC32.SQL_TYPE _boundParameterType; // if we bound already that is the type we used 81private ODBC32.SQL_C _prepared_Sql_C_Type; 298if ((ODBC32.SQL_C.NUMERIC == _bindtype._sql_c) && (0 != _internalPrecision)){ 303if (ODBC32.SQL_C.NUMERIC == _typemap._sql_c) { 309Debug.Assert((ODBC32.SQL_C.WCHAR == _bindtype._sql_c) || (ODBC32.SQL_C.BINARY == _bindtype._sql_c), "not wchar or binary"); 335if ((ODBC32.SQL_TYPE.CHAR == _bindtype._sql_type) 336|| (ODBC32.SQL_TYPE.VARCHAR == _bindtype._sql_type) 337|| (ODBC32.SQL_TYPE.LONGVARCHAR == _bindtype._sql_type)) { 347if ((ODBC32.SQL_TYPE.CHAR == _bindtype._sql_type) 348|| (ODBC32.SQL_TYPE.VARCHAR == _bindtype._sql_type) 349|| (ODBC32.SQL_TYPE.LONGVARCHAR == _bindtype._sql_type)) { 383if ((ODBC32.SQL_C.NUMERIC == _bindtype._sql_c) && (0 != _internalPrecision)){ 419if (ODBC32.SQL_C.NUMERIC == _typemap._sql_c) { 425Debug.Assert((ODBC32.SQL_C.WCHAR == _bindtype._sql_c) || (ODBC32.SQL_C.BINARY == _bindtype._sql_c), "not wchar or binary"); 430if (_bindtype._sql_c == ODBC32.SQL_C.WCHAR) { 455else if (ODBC32.SQL_C.WCHAR == _bindtype._sql_c) { 555ODBC32.SQL_C sql_c_type; 586case ODBC32.SQL_TYPE.DECIMAL: 587case ODBC32.SQL_TYPE.NUMERIC: 590|| !command.Connection.TestTypeSupport(ODBC32.SQL_TYPE.NUMERIC) // otherwise we convert if the driver does not support numeric 603case ODBC32.SQL_TYPE.BIGINT: 615case ODBC32.SQL_TYPE.WCHAR: // MDAC 68993 616case ODBC32.SQL_TYPE.WVARCHAR: 617case ODBC32.SQL_TYPE.WLONGVARCHAR: 626if (ODBC32.SQL_TYPE.WCHAR == _bindtype._sql_type) { _bindtype = TypeMap._Char; } 627else if (ODBC32.SQL_TYPE.WVARCHAR == _bindtype._sql_type) { _bindtype = TypeMap._VarChar; } 628else if (ODBC32.SQL_TYPE.WLONGVARCHAR == _bindtype._sql_type) { 641if (sql_c_type == ODBC32.SQL_C.WCHAR) { 642sql_c_type = ODBC32.SQL_C.CHAR; 660case ODBC32.SQL_TYPE.VARBINARY: 666case ODBC32.SQL_TYPE.VARCHAR: 672case ODBC32.SQL_TYPE.WVARCHAR: 691ODBC32.RetCode retcode; 692ODBC32.SQL_C sql_c_type = _prepared_Sql_C_Type; 693ODBC32.SQL_PARAM sqldirection = SqlDirectionFromParameterDirection(); 709if (ODBC32.SQL_C.NUMERIC == sql_c_type) { 714if ((ODBC32.SQL_PARAM.INPUT_OUTPUT == sqldirection) && (value is Decimal)) { 727if (ODBC32.SQL_PARAM.INPUT != sqldirection) { 764if (ODBC32.RetCode.SUCCESS != retcode) { 783if (ODBC32.SQL_C.NUMERIC == sql_c_type) { 784OdbcDescriptorHandle hdesc = command.GetDescriptorHandle(ODBC32.SQL_ATTR.APP_PARAM_DESC); 790retcode = hdesc.SetDescriptionField1(ordinal, ODBC32.SQL_DESC.TYPE, (IntPtr)ODBC32.SQL_C.NUMERIC); 792if (ODBC32.RetCode.SUCCESS != retcode) { 801retcode = hdesc.SetDescriptionField1(ordinal, ODBC32.SQL_DESC.PRECISION, (IntPtr)cbActual); 803if (ODBC32.RetCode.SUCCESS != retcode) { 812retcode = hdesc.SetDescriptionField1(ordinal, ODBC32.SQL_DESC.SCALE, (IntPtr)cbActual); 814if (ODBC32.RetCode.SUCCESS != retcode) { 821retcode = hdesc.SetDescriptionField2(ordinal, ODBC32.SQL_DESC.DATA_PTR, valueBuffer); 823if (ODBC32.RetCode.SUCCESS != retcode) { 841if (ODBC32.SQL_NULL_DATA == cbActual) { 844else if ((0 <= cbActual) || (cbActual == ODBC32.SQL_NTS)){ // safeguard 847if (_boundSqlCType== ODBC32.SQL_C.CHAR) { 857Debug.Assert(ODBC32.SQL_C.NUMERIC == _typemap._sql_c, "unexpected"); 913internal void SetInputValue(object value, ODBC32.SQL_C sql_c_type, int cbsize, int sizeorprecision, int offset, CNativeBuffer parameterBuffer) { //Handle any input params 919parameterBuffer.WriteIntPtr(_preparedIntOffset, (IntPtr)ODBC32.SQL_DEFAULT_PARAM); 922parameterBuffer.WriteIntPtr(_preparedIntOffset, (IntPtr)ODBC32.SQL_NULL_DATA); 926case ODBC32.SQL_C.CHAR: 927case ODBC32.SQL_C.WCHAR: 928case ODBC32.SQL_C.BINARY: 949parameterBuffer.WriteIntPtr(_preparedIntOffset, (IntPtr)ODBC32.SQL_NULL_DATA); 953private ODBC32.SQL_PARAM SqlDirectionFromParameterDirection () { 956return ODBC32.SQL_PARAM.INPUT; 961return ODBC32.SQL_PARAM.OUTPUT; 963return ODBC32.SQL_PARAM.INPUT_OUTPUT; 966return ODBC32.SQL_PARAM.INPUT;
fx\src\data\System\Data\Odbc\OdbcStatementHandle.cs (69)
71internal OdbcStatementHandle(OdbcConnectionHandle connectionHandle) : base(ODBC32.SQL_HANDLE.STMT, connectionHandle) { 74internal ODBC32.RetCode BindColumn2(int columnNumber, ODBC32.SQL_C targetType, HandleRef buffer, IntPtr length, IntPtr srLen_or_Ind) { 75ODBC32.RetCode retcode = UnsafeNativeMethods.SQLBindCol(this, checked((ushort)columnNumber), targetType, buffer, length, srLen_or_Ind); 80internal ODBC32.RetCode BindColumn3(int columnNumber, ODBC32.SQL_C targetType, IntPtr srLen_or_Ind) { 81ODBC32.RetCode retcode = UnsafeNativeMethods.SQLBindCol(this, checked((ushort)columnNumber), targetType, ADP.PtrZero, ADP.PtrZero, srLen_or_Ind); 86internal ODBC32.RetCode BindParameter(short ordinal, short parameterDirection, ODBC32.SQL_C sqlctype, ODBC32.SQL_TYPE sqltype, IntPtr cchSize, IntPtr scale, HandleRef buffer, IntPtr bufferLength, HandleRef intbuffer) { 87ODBC32.RetCode retcode = UnsafeNativeMethods.SQLBindParameter(this, 101internal ODBC32.RetCode Cancel() { 104ODBC32.RetCode retcode = UnsafeNativeMethods.SQLCancel(this); 109internal ODBC32.RetCode CloseCursor() { 110ODBC32.RetCode retcode = UnsafeNativeMethods.SQLCloseCursor(this); 115internal ODBC32.RetCode ColumnAttribute(int columnNumber, short fieldIdentifier, CNativeBuffer characterAttribute, out short stringLength, out SQLLEN numericAttribute) { 117ODBC32.RetCode retcode = UnsafeNativeMethods.SQLColAttributeW(this, checked((short)columnNumber), fieldIdentifier, characterAttribute, characterAttribute.ShortLength, out stringLength, out result); 123internal ODBC32.RetCode Columns(string tableCatalog, 127ODBC32.RetCode retcode = UnsafeNativeMethods.SQLColumnsW(this, 141internal ODBC32.RetCode Execute() { 142ODBC32.RetCode retcode = UnsafeNativeMethods.SQLExecute(this); 147internal ODBC32.RetCode ExecuteDirect(string commandText) { 148ODBC32.RetCode retcode = UnsafeNativeMethods.SQLExecDirectW(this, commandText, ODBC32.SQL_NTS); 153internal ODBC32.RetCode Fetch() { 154ODBC32.RetCode retcode = UnsafeNativeMethods.SQLFetch(this); 159internal ODBC32.RetCode FreeStatement(ODBC32.STMT stmt) { 160ODBC32.RetCode retcode = UnsafeNativeMethods.SQLFreeStmt(this, stmt); 165internal ODBC32.RetCode GetData(int index, ODBC32.SQL_C sqlctype, CNativeBuffer buffer, int cb, out IntPtr cbActual) { 166ODBC32.RetCode retcode = UnsafeNativeMethods.SQLGetData(this, 176internal ODBC32.RetCode GetStatementAttribute(ODBC32.SQL_ATTR attribute, out IntPtr value, out int stringLength) { 177ODBC32.RetCode retcode = UnsafeNativeMethods.SQLGetStmtAttrW(this, attribute, out value, ADP.PtrSize, out stringLength); 182internal ODBC32.RetCode GetTypeInfo(Int16 fSqlType) { 183ODBC32.RetCode retcode = UnsafeNativeMethods.SQLGetTypeInfo(this, fSqlType); 188internal ODBC32.RetCode MoreResults() { 189ODBC32.RetCode retcode = UnsafeNativeMethods.SQLMoreResults(this); 194internal ODBC32.RetCode NumberOfResultColumns(out short columnsAffected) { 195ODBC32.RetCode retcode = UnsafeNativeMethods.SQLNumResultCols(this, out columnsAffected); 200internal ODBC32.RetCode Prepare(string commandText) { 201ODBC32.RetCode retcode = UnsafeNativeMethods.SQLPrepareW(this, commandText, ODBC32.SQL_NTS); 206internal ODBC32.RetCode PrimaryKeys(string catalogName, string schemaName, string tableName) { 207ODBC32.RetCode retcode = UnsafeNativeMethods.SQLPrimaryKeysW(this, 216internal ODBC32.RetCode Procedures(string procedureCatalog, 219ODBC32.RetCode retcode = UnsafeNativeMethods.SQLProceduresW(this, 231internal ODBC32.RetCode ProcedureColumns(string procedureCatalog, 235ODBC32.RetCode retcode = UnsafeNativeMethods.SQLProcedureColumnsW(this, 249internal ODBC32.RetCode RowCount(out SQLLEN rowCount) { 251ODBC32.RetCode retcode = UnsafeNativeMethods.SQLRowCount(this, out result); 257internal ODBC32.RetCode SetStatementAttribute(ODBC32.SQL_ATTR attribute, IntPtr value, ODBC32.SQL_IS stringLength) { 258ODBC32.RetCode retcode = UnsafeNativeMethods.SQLSetStmtAttrW(this, (int)attribute, value, (int)stringLength); 263internal ODBC32.RetCode SpecialColumns(string quotedTable) { 264ODBC32.RetCode retcode = UnsafeNativeMethods.SQLSpecialColumnsW(this, 265ODBC32.SQL_SPECIALCOLS.ROWVER, null, 0, null, 0, 267ODBC32.SQL_SCOPE.SESSION, ODBC32.SQL_NULLABILITY.NO_NULLS); 272internal ODBC32.RetCode Statistics(string tableCatalog, 277ODBC32.RetCode retcode = UnsafeNativeMethods.SQLStatisticsW(this, 291internal ODBC32.RetCode Statistics(string tableName) { 292ODBC32.RetCode retcode = UnsafeNativeMethods.SQLStatisticsW(this, 295(Int16) ODBC32.SQL_INDEX.UNIQUE, 296(Int16) ODBC32.SQL_STATISTICS_RESERVED.ENSURE); 301internal ODBC32.RetCode Tables(string tableCatalog, 305ODBC32.RetCode retcode = UnsafeNativeMethods.SQLTablesW(this,
fx\src\data\System\Data\Odbc\OdbcTransaction.cs (17)
53int sql_iso= connection .GetConnectAttr(ODBC32.SQL_ATTR.TXN_ISOLATION, ODBC32.HANDLER.THROW); 54switch((ODBC32.SQL_TRANSACTION)sql_iso) { 55case ODBC32.SQL_TRANSACTION.READ_UNCOMMITTED: 58case ODBC32.SQL_TRANSACTION.READ_COMMITTED: 61case ODBC32.SQL_TRANSACTION.REPEATABLE_READ: 64case ODBC32.SQL_TRANSACTION.SERIALIZABLE: 67case ODBC32.SQL_TRANSACTION.SNAPSHOT: 94ODBC32.RetCode retcode = _handle.CompleteTransaction(ODBC32.SQL_COMMIT); 95if (retcode == ODBC32.RetCode.ERROR) { 114ODBC32.RetCode retcode = handle.CompleteTransaction(ODBC32.SQL_ROLLBACK); 115if (retcode == ODBC32.RetCode.ERROR) { 154ODBC32.RetCode retcode = _handle.CompleteTransaction(ODBC32.SQL_ROLLBACK); 155if (retcode == ODBC32.RetCode.ERROR) {
fx\src\data\System\Data\Odbc\OdbcUtils.cs (33)
29internal object MarshalToManaged(int offset, ODBC32.SQL_C sqlctype, int cb) { 33case ODBC32.SQL_C.WCHAR: 35if(cb == ODBC32.SQL_NTS) { 45case ODBC32.SQL_C.CHAR: 46case ODBC32.SQL_C.BINARY: 53case ODBC32.SQL_C.SSHORT: 57case ODBC32.SQL_C.SLONG: 61case ODBC32.SQL_C.SBIGINT: 65case ODBC32.SQL_C.BIT: 70case ODBC32.SQL_C.REAL: 74case ODBC32.SQL_C.DOUBLE: 78case ODBC32.SQL_C.UTINYINT: 82case ODBC32.SQL_C.GUID: 86case ODBC32.SQL_C.TYPE_TIMESTAMP: 103case ODBC32.SQL_C.TYPE_DATE: 115case ODBC32.SQL_C.TYPE_TIME: 126case ODBC32.SQL_C.NUMERIC: 155internal void MarshalToNative(int offset, object value, ODBC32.SQL_C sqlctype, int sizeorprecision, int valueOffset) { 157case ODBC32.SQL_C.WCHAR: 197case ODBC32.SQL_C.BINARY: 198case ODBC32.SQL_C.CHAR: 223case ODBC32.SQL_C.UTINYINT: 227case ODBC32.SQL_C.SSHORT: //Int16 231case ODBC32.SQL_C.SLONG: //Int32 235case ODBC32.SQL_C.REAL: //float 239case ODBC32.SQL_C.SBIGINT: //Int64 243case ODBC32.SQL_C.DOUBLE: //Double 247case ODBC32.SQL_C.GUID: //Guid 251case ODBC32.SQL_C.BIT: 255case ODBC32.SQL_C.TYPE_TIMESTAMP: 276case ODBC32.SQL_C.TYPE_DATE: 290case ODBC32.SQL_C.TYPE_TIME: 303case ODBC32.SQL_C.NUMERIC: