Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » UltraLite - .NET Programming » UltraLite .NET 2.0 API Reference » ULConnection class » GetSchema methods

GetSchema(String) method Next Page

GetSchema(String, String[]) method


Returns schema information for the data source of this ULConnection and, if specified, uses the specified string for the schema name and the specified string array for the restriction values.

Syntax

Visual Basic

Public Overrides Function GetSchema( _
ByVal collection As String, _
ByVal restrictions As String() _
) As DataTable

C#

public override DataTable GetSchema(
string collection,
string [] restrictions
);

Parameters
Return value

A DataTable that contains schema information.

Remarks

This method is used to query the database for various metadata. Each type of metadata is given a collection name, which must be passed to receive that data. The default collection name is MetaDataCollections.

You can query the .NET data provider to determine the list of supported schema collections by calling the GetSchema method with no arguments, or with the schema collection name MetaDataCollections. This will return a DataTable with a list of the supported schema collections (CollectionName), the number of restrictions that they each support (NumberOfRestrictions), and the number of identifier parts that they use (NumberOfIdentifierParts).

Collection

Metadata

ColumnsReturns information on all columns in the database.
DataSourceInformationReturns information about the database provider.
DataTypesReturns a list of supported data types.
ForeignKeysReturns information on all foreign keys in the database.
IndexColumnsReturns information on all index columns in the database.
IndexesReturns information on all indexes in the database.
MetaDataCollectionsReturns a list of all collection names.
Publications Returns information on all publications in the database.
ReservedWordsReturns a list of reserved words used by UltraLite.
RestrictionsReturns information on restrictions used in GetSchema.
TablesReturns information on all tables in the database.

These collection names are also available as read-only properties in the ULMetaDataCollectionNames class.

The results returned can be filtered by specifying an array of restrictions in the call to GetSchema.

The restrictions available with each collection can be queried by calling:

GetSchema( "Restrictions" )

If the collection requires four restrictions, then the restrictions parameter must be either NULL, or a string with four values.

To filter on a particular restriction, place the string to filter by in its place in the array and leave any unused places NULL. For example, the Tables collection has three restrictions: Table, TableType, SyncType.

To filter the Table collection:

GetSchema( "Tables", new string[ ] { "my_table", NULL, NULL } ) Returns information on all tables named my_table.

GetSchema( "Tables", new string[ ] { NULL, "User", NULL } ) Returns information on all user tables.

See also