Example #1
0
 public DBFField(string aFieldName,
                 DBFNativeDbType aType,
                 Int32 aFieldLength,
                 Int32 aDecimalCount)
 {
     Name = aFieldName;
     DataType = aType;
     FieldLength = aFieldLength;
     DecimalCount = aDecimalCount;
 }
Example #2
0
 public DBFField(string aFieldName,
                 DBFNativeDbType aType,
                 Int32 aFieldLength)
 {
     Name = aFieldName;
     DataType = aType;
     FieldLength = aFieldLength;
 }
Example #3
0
 public const string Unknown = "?"; //Unknown value
 static public DbType FromNative(DBFNativeDbType aByte)
 {
     switch (aByte)
     {
         case DBFNativeDbType.Char:
             return DbType.AnsiStringFixedLength;
         case DBFNativeDbType.Logical:
             return DbType.Boolean;
         case DBFNativeDbType.Numeric:
             return DbType.Decimal;
         case DBFNativeDbType.Date:
             return DbType.Date;
         case DBFNativeDbType.Float:
             return DbType.Decimal;
         case DBFNativeDbType.Memo:
             return DbType.AnsiString;
         default:
             throw new DBFException(
                 string.Format("Unsupported Native Type {0}", aByte));
     }
 }
Example #4
0
 public DBFField(string aFieldName, DBFNativeDbType aType)
 {
     Name = aFieldName;
     DataType = aType;
 }
Example #5
0
 static public Type TypeForNativeDBType(DBFNativeDbType aType)
 {
     switch (aType)
     {
         case DBFNativeDbType.Char:
             return typeof(string);
         case DBFNativeDbType.Date:
             return typeof(DateTime);
         case DBFNativeDbType.Numeric:
             return typeof(decimal);
         case DBFNativeDbType.Logical:
             return typeof(bool);
         case DBFNativeDbType.Float:
             return typeof(float);
         case DBFNativeDbType.Memo:
             return typeof(DBFMemoValue);
         default:
             throw new ArgumentException("Unsupported Type");
     }
 }