Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Current »

SchemaExplorer retrieves the various collections in the order that the database presents them. For all practical purposes, this means that the collections are in a random order. Often, you'll want a collection sorted by name instead. This is easily accomplished by creating a second collection of the same type and using the Sort method:

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

After running this code, the new tables collection will contain all of the tables from the source database, sorted by name.

  • No labels