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