3 namespace System.Data.Odbc
\r
6 /// Summary description for libodbchelper.
\r
8 internal class libodbchelper
\r
10 public static void DisplayError(string Msg, OdbcReturn Ret)
12 if ((Ret!=OdbcReturn.Success) && (Ret!=OdbcReturn.SuccessWithInfo))
\r
14 Console.WriteLine("ERROR: {0}: <{1}>",Msg,Ret);
19 internal static Type ODBCTypeToCILType(OdbcType type)
\r
23 case OdbcType.BigInt:
\r
24 return typeof(System.Int64);
\r
25 case OdbcType.Image:
\r
26 case OdbcType.VarBinary:
\r
27 case OdbcType.Binary:
\r
28 return typeof(byte[]);
\r
30 return typeof(bool);
\r
31 case OdbcType.NChar:
\r
33 return typeof(char);
\r
35 case OdbcType.Timestamp:
\r
36 case OdbcType.DateTime:
\r
38 case OdbcType.SmallDateTime:
\r
39 return typeof(DateTime);
\r
40 case OdbcType.Decimal:
\r
41 return typeof(Decimal);
\r
42 case OdbcType.Numeric:
\r
43 case OdbcType.Double:
\r
44 return typeof(Double);
\r
46 return typeof(System.Int32);
\r
48 case OdbcType.NText:
\r
49 case OdbcType.NVarChar:
\r
50 case OdbcType.VarChar:
\r
51 return typeof(string);
\r
53 return typeof(float);
\r
54 case OdbcType.SmallInt:
\r
55 return typeof(System.Int16);
\r
56 case OdbcType.UniqueIndetifier:
\r
57 return typeof(Guid);
\r
59 throw new InvalidCastException();
\r