Returns schema information for the data source of this ULConnection object and, if specified, uses the specified string for the schema name and the specified string array for the restriction values.
Public Overrides Function GetSchema(
ByVal collection As String,
ByVal restrictions As String()
) As DataTable
public override DataTable GetSchema(
string collection,
string[] restrictions
)
collection The name of the metadata collection. If no name is provided, the MetaDataCollections is used.
restrictions A set of restriction values for the requested schema.
A DataTable object that contains schema information.
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 returns 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 |
---|---|
Columns | Returns information about all columns in the database. |
DataSourceInformation | Returns information about the database provider. |
DataTypes | Returns a list of supported data types. |
ForeignKeys | Returns information about all foreign keys in the database. |
IndexColumns | Returns information about all index columns in the database. |
Indexes | Returns information about all indexes in the database. |
MetaDataCollections | Returns a list of all collection names. |
Publications | Returns information about all publications in the database. |
ReservedWords | Returns a list of reserved words used by UltraLite. |
Restrictions | Returns information about restrictions used in GetSchema. |
Tables | Returns information about 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 the GetSchema method.
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 about all tables named my_table.
GetSchema( "Tables", new string[ ] { NULL, "User", NULL } ) Returns information about all user tables.
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |