public static DataTable Open(string databasePath, string tableName, FieldInfo[] info) { DataTable table = new DataTable(); table.Fields = info; table.file = SequentialFile.Open(string.Format(@"{0}\{1}.dat", databasePath, tableName)); return table; }
public static DataTable Create(string databasePath, string tableName, FieldInfo[] info) { DataTable table = new DataTable(); int recordLength = 0; //calculate record length recordLength = CalculateRecordLength(info); //create file to store data in table.Fields = info; table.file = SequentialFile.Create(string.Format(@"{0}\{1}.dat", databasePath, tableName), recordLength); //return reference to new table return table; }