public static DbTypeInt Create(int bytes, bool unsigned) { DbTypeInt res = new DbTypeInt(); res.Bytes = bytes; res.Unsigned = unsigned; return(res); }
TableInfo GetStructure(SocialExplorer.IO.FastDBF.DbfFile dbf) { var res = new TableInfo(null); //output column names for (int i = 0; i < dbf.Header.ColumnCount; i++) { DbTypeBase type; // convert DBF type to DA type switch (dbf.Header[i].ColumnType) { case DbfColumn.DbfColumnType.Binary: type = new DbTypeBlob(); break; case DbfColumn.DbfColumnType.Boolean: type = new DbTypeLogical(); break; case DbfColumn.DbfColumnType.Date: type = new DbTypeDatetime {SubType = DbDatetimeSubType.Date}; break; case DbfColumn.DbfColumnType.Character: type = new DbTypeString {Length = dbf.Header[i].Length}; break; case DbfColumn.DbfColumnType.Integer: type = new DbTypeInt(); break; case DbfColumn.DbfColumnType.Memo: type = new DbTypeText(); break; case DbfColumn.DbfColumnType.Number: type = new DbTypeNumeric { Precision = dbf.Header[i].Length, Scale = dbf.Header[i].DecimalCount, }; break; default: type = new DbTypeString(); break; } var col = new ColumnInfo(res); col.Name = dbf.Header[i].Name; col.CommonType = type; //col.FillTypeFromCommonType(); res.Columns.Add(col); } return res; }
public static DbTypeInt Create(int bytes, bool unsigned) { DbTypeInt res = new DbTypeInt(); res.Bytes = bytes; res.Unsigned = unsigned; return res; }