internal static extern OdbcReturn SQLBindCol( IntPtr StmtHandle, short column, SQL_C_TYPE targetType, ref short value, int bufferLength, ref int indicator);
internal static extern OdbcReturn SQLGetData( IntPtr StatementHandle, ushort ColumnNumber, SQL_C_TYPE TargetType, byte[] TargetPtr, int BufferLen, ref int Len);
public OdbcTypeMap(DbType dbType, OdbcType odbcType, SQL_C_TYPE nativeType, SQL_TYPE sqlType) { DbType = dbType; OdbcType = odbcType; SqlType = sqlType; NativeType = nativeType; }
internal void UpdateTypes(SQL_TYPE sqlType) { SqlType = sqlType; OdbcTypeMap map = OdbcTypeConverter.GetTypeMap(SqlType); OdbcType = map.OdbcType; SqlCType = map.NativeType; }
internal static extern OdbcReturn SQLBindParameter( IntPtr StatementHandle, ushort ParamNum, short InputOutputType, SQL_C_TYPE ValueType, SQL_TYPE ParamType, uint ColSize, short DecimalDigits, IntPtr ParamValue, int BufLen, IntPtr StrLen);
internal static extern OdbcReturn SQLBindCol ( IntPtr StmtHandle, short column, SQL_C_TYPE targetType, ref short value, int bufferLength, ref int indicator);
internal static extern OdbcReturn SQLBindParameter ( IntPtr StatementHandle, ushort ParamNum, short InputOutputType, SQL_C_TYPE ValueType, SQL_TYPE ParamType, uint ColSize, short DecimalDigits, IntPtr ParamValue, int BufLen, IntPtr StrLen);
internal static extern OdbcReturn SQLGetData ( IntPtr StatementHandle, ushort ColumnNumber, SQL_C_TYPE TargetType, byte[] TargetPtr, int BufferLen, ref int Len);
public TypeMap (OdbcType odbcType, SQL_C_TYPE sqlCType, SQL_TYPE sqlType) { OdbcType = odbcType; SqlType = sqlType; SqlCType = sqlCType; BitMask = DefaultForOdbcType | DefaultForSQLCType | DefaultForSQLType ; }
public int IndexOf (SQL_C_TYPE sqlCType) { for (int i=0; i < List.Count; i++) { TypeMap map = (TypeMap) List [i]; if (map.SqlCType == sqlCType && (map.BitMask & TypeMap.DefaultForSQLCType) > 0 ) return i; } return -1; }
public TypeMap this [SQL_C_TYPE sqlCType] { get { foreach (TypeMap map in List){ if (map.SqlCType == sqlCType && (map.BitMask & TypeMap.DefaultForSQLCType) > 0 ) return map; } throw new ArgumentException (String.Format ("Type mapping for odbc type {0} is not found", sqlCType.ToString () ) ); } set { int i = IndexOf (sqlCType); if (i == -1) Add (value); List [i] = value; } }
public TypeMap (OdbcType odbcType, SQL_C_TYPE sqlCType, SQL_TYPE sqlType, short defaultFlags) : this (odbcType, sqlCType, sqlType) { BitMask = defaultFlags; }
internal void UpdateTypes (SQL_TYPE sqlType) { SqlType = sqlType; OdbcTypeConverter.TypeMap map = OdbcTypeConverter.GetTypeMap (SqlType); OdbcType = map.OdbcType; SqlCType = map.SqlCType; }
public OdbcTypeMap (DbType dbType, OdbcType odbcType, SQL_C_TYPE nativeType, SQL_TYPE sqlType) { DbType = dbType; OdbcType = odbcType; SqlType = sqlType; NativeType = nativeType; }