OleDbToNetTypeConverter() public static method

public static OleDbToNetTypeConverter ( OleDbType oleDbTypeNumber ) : Type
oleDbTypeNumber OleDbType
return System.Type
Beispiel #1
0
        static public ColumnType DatabaseToNetTypeConverter(object dbValue)
        {
            ColumnType result = ColumnType.Text;

            try
            {
                OleDbType columnType = (OleDbType)dbValue;
                result = Helper.NetTypeConverter(Helper.OleDbToNetTypeConverter(columnType));
            }
            catch { }
            return(result);
        }
Beispiel #2
0
        static public ColumnType DatabaseToNetTypeConverter(object dbValue)
        {
            ColumnType result = ColumnType.Text;

            try
            {
                OleDbType columnType = (OleDbType)Convert.ToInt32(dbValue);
                result = Helper.NetTypeConverter(Helper.OleDbToNetTypeConverter(columnType));
                if (columnType == OleDbType.WChar || columnType == OleDbType.VarWChar || columnType == OleDbType.LongVarWChar)
                {
                    result = ColumnType.UnicodeText;
                }
            }
            catch { }
            return(result);
        }