public DataTable GetOleDbSchemaTable(Guid schema, object[] restrictions) // MDAC 61846 { OleDbConnection.ExecutePermission.Demand(); IntPtr hscp; Bid.ScopeEnter(out hscp, "<oledb.OleDbConnection.GetOleDbSchemaTable|API> %d#, schema=%ls, restrictions\n", ObjectID, schema); try { CheckStateOpen(ADP.GetOleDbSchemaTable); OleDbConnectionInternal connection = GetOpenConnection(); if (OleDbSchemaGuid.DbInfoLiterals == schema) { if ((null == restrictions) || (0 == restrictions.Length)) { return(connection.BuildInfoLiterals()); } throw ODB.InvalidRestrictionsDbInfoLiteral("restrictions"); } else if (OleDbSchemaGuid.SchemaGuids == schema) { if ((null == restrictions) || (0 == restrictions.Length)) { return(connection.BuildSchemaGuids()); } throw ODB.InvalidRestrictionsSchemaGuids("restrictions"); } else if (OleDbSchemaGuid.DbInfoKeywords == schema) { if ((null == restrictions) || (0 == restrictions.Length)) { return(connection.BuildInfoKeywords()); } throw ODB.InvalidRestrictionsDbInfoKeywords("restrictions"); } if (connection.SupportSchemaRowset(schema)) { return(connection.GetSchemaRowset(schema, restrictions)); } else { using (IDBSchemaRowsetWrapper wrapper = connection.IDBSchemaRowset()) { if (null == wrapper.Value) { throw ODB.SchemaRowsetsNotSupported(Provider); // MDAC 72689 } } throw ODB.NotSupportedSchemaTable(schema, this); // MDAC 63279 } } finally { Bid.ScopeLeave(ref hscp); } }
public DataTable GetOleDbSchemaTable(Guid schema, object[] restrictions) { DataTable table; IntPtr ptr; ExecutePermission.Demand(); Bid.ScopeEnter(out ptr, "<oledb.OleDbConnection.GetOleDbSchemaTable|API> %d#, schema=%ls, restrictions\n", this.ObjectID, schema); try { this.CheckStateOpen("GetOleDbSchemaTable"); OleDbConnectionInternal openConnection = this.GetOpenConnection(); if (OleDbSchemaGuid.DbInfoLiterals == schema) { if ((restrictions != null) && (restrictions.Length != 0)) { throw ODB.InvalidRestrictionsDbInfoLiteral("restrictions"); } return(openConnection.BuildInfoLiterals()); } if (OleDbSchemaGuid.SchemaGuids == schema) { if ((restrictions != null) && (restrictions.Length != 0)) { throw ODB.InvalidRestrictionsSchemaGuids("restrictions"); } return(openConnection.BuildSchemaGuids()); } if (OleDbSchemaGuid.DbInfoKeywords == schema) { if ((restrictions != null) && (restrictions.Length != 0)) { throw ODB.InvalidRestrictionsDbInfoKeywords("restrictions"); } return(openConnection.BuildInfoKeywords()); } if (openConnection.SupportSchemaRowset(schema)) { return(openConnection.GetSchemaRowset(schema, restrictions)); } using (IDBSchemaRowsetWrapper wrapper = openConnection.IDBSchemaRowset()) { if (wrapper.Value == null) { throw ODB.SchemaRowsetsNotSupported(this.Provider); } } throw ODB.NotSupportedSchemaTable(schema, this); } finally { Bid.ScopeLeave(ref ptr); } return(table); }
public DataTable GetOleDbSchemaTable(Guid schema, object[] restrictions) { CheckStateOpen(ADP.GetOleDbSchemaTable); OleDbConnectionInternal connection = GetOpenConnection(); if (OleDbSchemaGuid.DbInfoLiterals == schema) { if ((null == restrictions) || (0 == restrictions.Length)) { return(connection.BuildInfoLiterals()); } throw ODB.InvalidRestrictionsDbInfoLiteral("restrictions"); } else if (OleDbSchemaGuid.SchemaGuids == schema) { if ((null == restrictions) || (0 == restrictions.Length)) { return(connection.BuildSchemaGuids()); } throw ODB.InvalidRestrictionsSchemaGuids("restrictions"); } else if (OleDbSchemaGuid.DbInfoKeywords == schema) { if ((null == restrictions) || (0 == restrictions.Length)) { return(connection.BuildInfoKeywords()); } throw ODB.InvalidRestrictionsDbInfoKeywords("restrictions"); } if (connection.SupportSchemaRowset(schema)) { return(connection.GetSchemaRowset(schema, restrictions)); } else { using (IDBSchemaRowsetWrapper wrapper = connection.IDBSchemaRowset()) { if (null == wrapper.Value) { throw ODB.SchemaRowsetsNotSupported(Provider); } } throw ODB.NotSupportedSchemaTable(schema, this); } }