Returns a DataTable with a specified set of metadata for the data source associated with this DB2Connection instance.
[Visual Basic]
Public Overrides Function GetSchema ( _
collectionName As String, _
restrictionValues As String() _
) As DataTable
[C#]
public override DataTable GetSchema (
string collectionName,
string[] restrictionValues
);
[C++]
public:
virtual DataTable^ GetSchema (
String collectionName,
array<String^>^ restrictionValues
) override
[JScript]
public override function GetSchema (
collectionName : String,
restrictionValues : String[]
) : DataTable
Collection name | Description |
---|---|
DB2MetaDataCollectionNames.MetaDataCollections | A list of the metadata collections supported by the IBM® Data Provider for .NET. |
DB2MetaDataCollectionNames.Restrictions | For each metadata collection, a list of qualifiers that can be used to restrict the scope of the requested metadata. |
DB2MetaDataCollectionNames.DataSourceInformation | Information about the data source associated with this DB2Connection instance. |
DB2MetaDataCollectionNames.DataTypes | A list of all the data types supported by DB2® family databases. |
DB2MetaDataCollectionNames.ReservedWords | A list of all the reserved words for the DB2 family SQL dialect. |
DB2MetaDataCollectionNames.Tables | A list of the tables in the data source associated with this DB2Connection instance. |
DB2MetaDataCollectionNames.TablePrivileges | A list of the table privileges in the data source associated with this DB2Connection instance. |
DB2MetaDataCollectionNames.Columns | A list of the table columns in the data source associated with this DB2Connection instance. |
DB2MetaDataCollectionNames.ColumnPrivileges | A list of the column privileges in the data source associated with this DB2Connection instance. |
DB2MetaDataCollectionNames.Procedures | A list of the stored procedures in the data source associated with this DB2Connection instance. |
DB2MetaDataCollectionNames.ProcedureParameters | A list of the stored procedure parameters in the data source associated with this DB2Connection instance. |
DB2MetaDataCollectionNames.PrimaryKeys | A list of the table primary keys in the data source associated with this DB2Connection instance. |
DB2MetaDataCollectionNames.ForeignKeys | A list of the table foreign keys in the data source associated with this DB2Connection instance. |
DB2MetaDataCollectionNames.Indexes | A list of the indexes in the data source associated with this DB2Connection instance. |
DB2MetaDataCollectionNames.Schemas | A list of the schemas in the data source associated with this DB2Connection instance. |
DataTable resttable =
conn.GetSchema(DB2MetaDataCollectionNames.Restrictions);
A DataTable instance, which contains information about the visible DB2 family databases.
[C#] The following line of code demonstrates how to retrieve the available metadata for the data source associated with this DB2Connection instance. The use of this particular overload of GetSchema (with a String and a String array parameters) results in the retrieval of a list of the tables in the data source associated with the ERIK schema.
[C#]
DataTable eriktab = conn.GetSchema(DB2MetaDataCollectionNames.Tables,
new string[4] { null, "ERIK", null, null } );