-
Notifications
You must be signed in to change notification settings - Fork 0
/
ODBC.cs
102 lines (81 loc) · 3.34 KB
/
ODBC.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
using System;
using System.Data;
using Arad.Net.Core.Informix.System;
using Arad.Net.Core.Informix.System.Data.Common;
using System.Globalization;
namespace Arad.Net.Core.Informix;
internal static class ODBC
{
internal const string Pwd = "pwd";
internal static Exception ConnectionClosed()
{
return ADP.InvalidOperation(SR.GetString(SR.Odbc_ConnectionClosed));
}
internal static Exception OpenConnectionNoOwner()
{
return ADP.InvalidOperation(SR.GetString(SR.Odbc_OpenConnectionNoOwner));
}
internal static Exception UnknownSQLType(Informix32.SQL_TYPE sqltype)
{
return ADP.Argument(SR.GetString(SR.Odbc_UnknownSQLType, sqltype.ToString()));
}
internal static Exception ConnectionStringTooLong()
{
return ADP.Argument(SR.GetString(SR.OdbcConnection_ConnectionStringTooLong, 1024));
}
internal static ArgumentException GetSchemaRestrictionRequired()
{
return ADP.Argument(SR.GetString(SR.ODBC_GetSchemaRestrictionRequired));
}
internal static ArgumentOutOfRangeException NotSupportedEnumerationValue(Type type, int value)
{
return ADP.ArgumentOutOfRange(SR.GetString(SR.ODBC_NotSupportedEnumerationValue, type.Name, value.ToString(CultureInfo.InvariantCulture)), type.Name);
}
internal static ArgumentOutOfRangeException NotSupportedCommandType(CommandType value)
{
return NotSupportedEnumerationValue(typeof(CommandType), (int)value);
}
internal static ArgumentOutOfRangeException NotSupportedIsolationLevel(IsolationLevel value)
{
return NotSupportedEnumerationValue(typeof(IsolationLevel), (int)value);
}
internal static InvalidOperationException NoMappingForSqlTransactionLevel(int value)
{
return ADP.DataAdapter(SR.GetString(SR.Odbc_NoMappingForSqlTransactionLevel, value.ToString(CultureInfo.InvariantCulture)));
}
internal static Exception NegativeArgument()
{
return ADP.Argument(SR.GetString(SR.Odbc_NegativeArgument));
}
internal static Exception CantSetPropertyOnOpenConnection()
{
return ADP.InvalidOperation(SR.GetString(SR.Odbc_CantSetPropertyOnOpenConnection));
}
internal static Exception CantEnableConnectionpooling(Informix32.RetCode retcode)
{
return ADP.DataAdapter(SR.GetString(SR.Odbc_CantEnableConnectionpooling, Informix32.RetcodeToString(retcode)));
}
internal static Exception CantAllocateEnvironmentHandle(Informix32.RetCode retcode)
{
return ADP.DataAdapter(SR.GetString(SR.Odbc_CantAllocateEnvironmentHandle, Informix32.RetcodeToString(retcode)));
}
internal static Exception FailedToGetDescriptorHandle(Informix32.RetCode retcode)
{
return ADP.DataAdapter(SR.GetString(SR.Odbc_FailedToGetDescriptorHandle, Informix32.RetcodeToString(retcode)));
}
internal static Exception NotInTransaction()
{
return ADP.InvalidOperation(SR.GetString(SR.Odbc_NotInTransaction));
}
internal static Exception UnknownOdbcType(InformixType odbctype)
{
return ADP.InvalidEnumerationValue(typeof(InformixType), (int)odbctype);
}
internal static void TraceODBC(int level, string method, Informix32.RetCode retcode)
{
}
internal static short ShortStringLength(string inputString)
{
return checked((short)ADP.StringLength(inputString));
}
}