Sorting collections

SchemaExplorer returns its collections in the order the database presents them, which for practical purposes is random. To sort a collection by name, create a second collection of the same type and call its Sort method:

TableSchemaCollection tables = new TableSchemaCollection(SourceDatabase.Tables);
tables.Sort(new PropertyComparer("Name"));

The new tables collection contains all the tables in the source database, sorted by name.