System.Data.OleDb Namespace OleDbConnection Class
Returns the schema information of a data source.
[ VB ]
Public Function GetOleDbSchemaTable ( _
ByVal schema As Guid, _
ByVal restrictions ( ) As Object _
) As DataTable
[ C# ]
public DataTable GetOleDbSchemaTable (
Guid schema,
object [ ] restrictions
);
[ C++ ]
public: DataTable* GetOleDbSchemaTable (
Guid schema,
Object* restrictions __gc [ ]
);
[ C++ ]
public function GetOleDbSchemaTable (
schema : Guid,
restrictions : Object [ ]
) : DataTable;
- schema
- One of the OleDbSchemaGuid values that specifies the schema table to return.
- restrictions
- An array of objects that are filter values, each of which corresponds to a DataColumn in the resulting DataTable.
A DataTable containing a list of schema restrictions.
The schema information is returned as a DataTable that has the same columns structure as the OLE DB schema rowset specified by the given OleDbSchemaGuid value passed via the schema parameter.
Use the restrictions parameter to filter the rows to be returned in the DataTable ( for example, by specifying restrictions for tablename, type, owner, or schema ).
When you pass values in the restrictions array, include empty strings for array elements that do not contain values. If you pass an empty array to restrictions, all rows ( one for each table ) are returned in default order. Values in the array correspond to the order of the columns in the source table and DataTable.
The OleDbConnection method calls the underlying OLE DB IDBSchemaRowset::GetRowset method using standard common language runtime conversion rules.
You can retrieve information about literals by using DbInfoLiterals, which provides information equivalent to calling the OLE DB IDBInfo::GetLiteralInfo interface, or the ADO Connection.OpenSchema method with the adSchemaDBInfoLiterals constant.
The following sample uses GetOleDbSchemaTable to return the list of tables from a database, that is then used to populate an HtmlSelect control.
Show me
OleDbConnection Members OleDbSchemaGuid Obtaining Schema Information from a Database