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