You can use the non-generic XTable class.
The XTable is a lightweight wrapper of the generic XTable<TKey, TRecord>. The XTable class provides the opportunity to look at all heterogeneous generic XTables in homogeneous way - as a XTable<object,object>.
For example, if we have two tables with different keys (or records)
using (StorageEngine engine = StorageEngine.FromFile("test.stsdb"))
{
var table1 = engine.Scheme.CreateOrOpenXTable<int, string>(new Locator("table1"));
var table2 = engine.Scheme.CreateOrOpenXTable<double, string>(new Locator("table2"));
engine.Scheme.Commit();
for (int i = 0; i < 100; i++)
table1[i] = i.ToString();
table1.Commit();
for (int i = 0; i < 100; i++)
table2[i / 10.0] = i.ToString();
table2.Commit();
}
we can open them as a non-generic XTables and treat them the same way:
using (StorageEngine engine = StorageEngine.FromFile("test.stsdb"))
{
XTable table1 = engine.Scheme.OpenXTable(new Locator("table1"));
ShowInfo(table1);
XTable table2 = engine.Scheme.OpenXTable(new Locator("table2"));
ShowInfo(table2);
}
The ShowInfo() method is:
public void ShowInfo(XTable table)
{
foreach (var row in table.Forward())
{
Console.WriteLine("{0} -> {1}", row.Key, row.Record);
}
Console.WriteLine("XTable<{0},{1}>", table.KeyType, table.RecordType);
Console.WriteLine("{0} records", table.Count);
}