コード例 #1
0
ファイル: NativeDBType.cs プロジェクト: maikebing/_KeelKit
        internal static NativeDBType FromDBType(short dbType, bool isLong, bool isFixed)
        {
            switch (dbType)
            {
            case 2:
                return(D_SmallInt);

            case 3:
                return(D_Integer);

            case 4:
                return(D_Single);

            case 5:
                return(D_Double);

            case 6:
                return(D_Currency);

            case 7:
                return(D_Date);

            case 8:
                return(D_BSTR);

            case 9:
                return(D_IDispatch);

            case 10:
                return(D_Error);

            case 11:
                return(D_Boolean);

            case 12:
                return(D_Variant);

            case 13:
                return(D_IUnknown);

            case 14:
                return(D_Decimal);

            case 0x10:
                return(D_TinyInt);

            case 0x11:
                return(D_UnsignedTinyInt);

            case 0x12:
                return(D_UnsignedSmallInt);

            case 0x13:
                return(D_UnsignedInt);

            case 20:
                return(D_BigInt);

            case 0x15:
                return(D_UnsignedBigInt);

            case 0x40:
                return(D_Filetime);

            case 0x80:
                if (isLong)
                {
                    return(D_LongVarBinary);
                }
                if (isFixed)
                {
                    return(D_Binary);
                }
                return(D_VarBinary);

            case 0x81:
                if (isLong)
                {
                    return(D_LongVarChar);
                }
                if (isFixed)
                {
                    return(D_Char);
                }
                return(D_VarChar);

            case 130:
                if (isLong)
                {
                    return(D_LongVarWChar);
                }
                if (isFixed)
                {
                    return(D_WChar);
                }
                return(D_VarWChar);

            case 0x83:
                return(D_Numeric);

            case 0x84:
                return(D_Udt);

            case 0x85:
                return(D_DBDate);

            case 0x86:
                return(D_DBTime);

            case 0x87:
                return(D_DBTimeStamp);

            case 0x88:
                return(D_Chapter);

            case 0x8a:
                return(D_PropVariant);

            case 0x8b:
                return(D_VarNumeric);

            case 0x8d:
                return(D_Xml);

            case 0x48:
                return(D_Guid);
            }
            if ((0x1000 & dbType) != 0)
            {
                throw ODB.DBBindingGetVector();
            }
            return(D_Variant);
        }