System.Data.OleDb.OleDbConnection.GetOleDbSchemaTable Method

Returns schema information from a data source as indicated by a GUID, and after it applies the specified restrictions.


public System.Data.DataTable GetOleDbSchemaTable (Guid schema, object[] restrictions)


One of the System.Data.OleDb.OleDbSchemaGuid values that specifies the schema table to return.
An object array of restriction values. These are applied in the order of the restriction columns. That is, the first restriction value applies to the first restriction column, the second restriction value applies to the second restriction column, and so on.


A System.Data.DataTable that contains the requested schema information.


The schema table is returned as a System.Data.DataTable that has the same format as the OLE DB schema rowset specified by the schema parameter. Use the restrictions parameter to filter the rows to be returned in the System.Data.DataTable (for example, by specifying restrictions for table name, type, owner, or schema). When you pass values in the array, include empty strings or nulls 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 System.Data.DataTable. Each element in the restrictions array is compared with the content of the corresponding column in the schema rowset. For example, the first element in the restrictions array is compared to first column in the rowset. If a restriction element is not null, only rows from the schema rowset that exactly match the value of the restriction are added to the resulting System.Data.DataTable.

The System.Data.OleDb.OleDbConnection method calls the underlying OLE DB IDBSchemaRowset::GetRowset method using standard common language runtime conversion rules. For more information, see COM Data Types.

You can retrieve information about literals by using OleDbSchemaGuid.DbInfoLiterals. This provides information equivalent to calling the OLE DB IDBInfo::GetLiteralInfo interface, or the ADO Connection.OpenSchema method with the adSchemaDBInfoLiterals constant.


Namespace: System.Data.OleDb
Assembly: System.Data (in System.Data.dll)
Assembly Versions: 1.0.5000.0,