Example #1
0
        public const string Unknown   = "?";  //Unknown value

        public static DbType FromNative(NativeDbType aByte)
        {
            switch (aByte)
            {
            case NativeDbType.UnicodeChar:
                return(DbType.StringFixedLength);

            case NativeDbType.Char:
                return(DbType.AnsiStringFixedLength);

            case NativeDbType.Logical:
                return(DbType.Boolean);

            case NativeDbType.Numeric:
                return(DbType.Decimal);

            case NativeDbType.Date:
                return(DbType.Date);

            case NativeDbType.Float:
                return(DbType.Decimal);

            case NativeDbType.Memo:
                return(DbType.AnsiString);

            default:
                throw new DBFException(
                          $"Unsupported Native Type {aByte}");
            }
        }
Example #2
0
        public static Type TypeForNativeDBType(NativeDbType aType)
        {
            switch (aType)
            {
            case NativeDbType.Char:
                return(typeof(string));

            case NativeDbType.Date:
                return(typeof(DateTime));

            case NativeDbType.Numeric:
                return(typeof(decimal));

            case NativeDbType.Logical:
                return(typeof(bool));

            case NativeDbType.Float:
                return(typeof(float));

            case NativeDbType.Memo:
                return(typeof(MemoValue));

            default:
                throw new ArgumentException("Unsupported Type");
            }
        }
Example #3
0
        public static Type TypeForNativeDBType(NativeDbType aType)
        {
            switch (aType)
            {
            case NativeDbType.Char:
                return(typeof(string));

            case NativeDbType.Date:
                return(typeof(DateTime));

            case NativeDbType.Numeric:
                return(typeof(decimal));

            case NativeDbType.Logical:
                return(typeof(bool));

            case NativeDbType.Float:
                return(typeof(decimal));

            case NativeDbType.Memo:
                return(typeof(MemoValue));

            default:
                return(typeof(Object));
            }
        }
Example #4
0
        public const string Unknown   = "?";  //Unknown value

        public static DbType FromNative(NativeDbType @byte)
        {
            switch (@byte)
            {
            case NativeDbType.Char:
                return(DbType.AnsiStringFixedLength);

            case NativeDbType.Logical:
                return(DbType.Boolean);

            case NativeDbType.Numeric:
                return(DbType.Decimal);

            case NativeDbType.Date:
                return(DbType.Date);

            case NativeDbType.Float:
                return(DbType.Decimal);

            case NativeDbType.Memo:
                return(DbType.AnsiString);

            default:
                return(DbType.Object);
            }
        }
Example #5
0
        public const string Unknown   = "?";  //Unknown value
        static public DbType FromNative(NativeDbType aByte)
        {
            switch (aByte)
            {
            case NativeDbType.Char:
                return(DbType.AnsiStringFixedLength);

            case NativeDbType.Logical:
                return(DbType.Boolean);

            case NativeDbType.Numeric:
                return(DbType.Decimal);

            case NativeDbType.Date:
                return(DbType.Date);

            case NativeDbType.Float:
                //    return DbType.Decimal;
                return(DbType.Double);

            case NativeDbType.Memo:
                return(DbType.AnsiString);

            case NativeDbType.Double:
                return(DbType.Double);

            default:
                throw new DBFException(
                          string.Format("Unsupported Native Type {0}", aByte));
            }
        }
Example #6
0
 public DBFField(string aFieldName,
                 NativeDbType aType,
                 Int32 aFieldLength)
 {
     Name        = aFieldName;
     DataType    = aType;
     FieldLength = aFieldLength;
 }
Example #7
0
 public DBFField(string aFieldName,
                 NativeDbType aType,
                 Int32 aFieldLength)
 {
     Name = aFieldName;
     DataType = aType;
     FieldLength = aFieldLength;
 }
Example #8
0
 public DBFField(string fieldName,
                 NativeDbType type,
                 int fieldLength)
 {
     Name        = fieldName;
     DataType    = type;
     FieldLength = fieldLength;
 }
Example #9
0
 public DBFField(string aFieldName,
                 NativeDbType aType,
                 Int32 aFieldLength,
                 Int32 aDecimalCount)
 {
     Name         = aFieldName;
     DataType     = aType;
     FieldLength  = aFieldLength;
     DecimalCount = aDecimalCount;
 }
Example #10
0
 public DBFField(string aFieldName,
                 NativeDbType aType,
                 Int32 aFieldLength,
                 Int32 aDecimalCount)
 {
     Name = aFieldName;
     DataType = aType;
     FieldLength = aFieldLength;
     DecimalCount = aDecimalCount;
 }
Example #11
0
 public DBFField(string fieldName,
                 NativeDbType type,
                 int fieldLength,
                 int decimalCount)
 {
     Name         = fieldName;
     DataType     = type;
     FieldLength  = fieldLength;
     DecimalCount = decimalCount;
 }
Example #12
0
 public static DbType FromNative(NativeDbType aByte)
 {
     switch (aByte)
     {
         case NativeDbType.Char:
             return DbType.AnsiStringFixedLength;
         case NativeDbType.Logical:
             return DbType.Boolean;
         case NativeDbType.Numeric:
             return DbType.Decimal;
         case NativeDbType.Date:
             return DbType.Date;
         case NativeDbType.Float:
             return DbType.Decimal;
         case NativeDbType.Memo:
             return DbType.AnsiString;
         default:
             throw new DBFException(
                 string.Format("Unsupported Native Type {0}", aByte));
     }
 }
Example #13
0
 public DBFField(string aFieldName, NativeDbType aType)
 {
     Name     = aFieldName;
     DataType = aType;
 }
Example #14
0
 public static Type TypeForNativeDBType(NativeDbType aType)
 {
     switch(aType)
     {
         case NativeDbType.Char:
             return typeof (string);
         case NativeDbType.Date:
             return typeof (DateTime);
         case NativeDbType.Numeric:
             return typeof (decimal);
         case NativeDbType.Logical:
             return typeof (bool);
         case NativeDbType.Float:
             return typeof (float);
         case NativeDbType.Memo:
             return typeof (MemoValue);
         default:
             throw new ArgumentException("Unsupported Type");
     }
 }
Example #15
0
 public DBFField(string aFieldName, NativeDbType aType)
 {
     Name = aFieldName;
     DataType = aType;
 }
Example #16
0
 public DBFField(string fieldName, NativeDbType type)
 {
     Name     = fieldName;
     DataType = type;
 }