public override DataTable GetTableSchema(TableName tname) { List <SchemaRow> rows = new List <SchemaRow>(); LoadColumns(rows, tname); LoadForeignKeys(rows, tname); DataTable schemaTable = SchemaRowExtension.CreateTable(); rows.ToDataTable(schemaTable); schemaTable.Columns.Remove(SchemaRowExtension._SCHEMANAME); schemaTable.Columns.Remove(SchemaRowExtension._TABLENAME); schemaTable.AcceptChanges(); return(schemaTable); }
private static DataTable LoadDatabaseSchema(DatabaseName dname) { List <SchemaRow> rows = new List <SchemaRow>(); foreach (TableName tname in dname.GetTableNames()) { LoadColumns(rows, tname); LoadForeignKeys(rows, tname); } DataTable schemaTable = SchemaRowExtension.CreateTable(); rows.ToDataTable(schemaTable); schemaTable.AcceptChanges(); return(schemaTable); }