DbConnection.GetSchema DbConnection.GetSchema DbConnection.GetSchema DbConnection.GetSchema Method

定义

返回此 DbConnection 的数据源的架构信息。Returns schema information for the data source of this DbConnection.

重载

GetSchema() GetSchema() GetSchema() GetSchema()

返回此 DbConnection 的数据源的架构信息。Returns schema information for the data source of this DbConnection.

GetSchema(String) GetSchema(String) GetSchema(String) GetSchema(String)

通过使用架构名称的指定字符串,返回此 DbConnection 的数据源的架构信息。Returns schema information for the data source of this DbConnection using the specified string for the schema name.

GetSchema(String, String[]) GetSchema(String, String[]) GetSchema(String, String[]) GetSchema(String, String[])

通过使用指定字符串作为架构名称,指定字符串数组作为限制值,返回此 DbConnection 的数据源的架构信息。Returns schema information for the data source of this DbConnection using the specified string for the schema name and the specified string array for the restriction values.

注解

如果连接与事务相关联,则执行GetSchema调用可能会导致某些提供程序引发异常。If the connection is associated with a transaction, executing GetSchema calls may cause some providers to throw an exception.

GetSchema() GetSchema() GetSchema() GetSchema()

返回此 DbConnection 的数据源的架构信息。Returns schema information for the data source of this DbConnection.

public:
 virtual System::Data::DataTable ^ GetSchema();
public virtual System.Data.DataTable GetSchema ();
abstract member GetSchema : unit -> System.Data.DataTable
override this.GetSchema : unit -> System.Data.DataTable
Public Overridable Function GetSchema () As DataTable

返回

一个包含架构信息的 DataTableA DataTable that contains schema information.

注解

如果连接与事务相关联,则执行GetSchema调用可能会导致某些提供程序引发异常。If the connection is associated with a transaction, executing GetSchema calls may cause some providers to throw an exception.

另请参阅

GetSchema(String) GetSchema(String) GetSchema(String) GetSchema(String)

通过使用架构名称的指定字符串,返回此 DbConnection 的数据源的架构信息。Returns schema information for the data source of this DbConnection using the specified string for the schema name.

public:
 virtual System::Data::DataTable ^ GetSchema(System::String ^ collectionName);
public virtual System.Data.DataTable GetSchema (string collectionName);
abstract member GetSchema : string -> System.Data.DataTable
override this.GetSchema : string -> System.Data.DataTable
Public Overridable Function GetSchema (collectionName As String) As DataTable

参数

collectionName
String String String String

指定要返回的架构的名称。Specifies the name of the schema to return.

返回

一个包含架构信息的 DataTableA DataTable that contains schema information.

异常

collectionName 指定为 null。collectionName is specified as null.

注解

如果连接与事务相关联,则执行GetSchema调用可能会导致某些提供程序引发异常。If the connection is associated with a transaction, executing GetSchema calls may cause some providers to throw an exception.

另请参阅

GetSchema(String, String[]) GetSchema(String, String[]) GetSchema(String, String[]) GetSchema(String, String[])

通过使用指定字符串作为架构名称,指定字符串数组作为限制值,返回此 DbConnection 的数据源的架构信息。Returns schema information for the data source of this DbConnection using the specified string for the schema name and the specified string array for the restriction values.

public:
 virtual System::Data::DataTable ^ GetSchema(System::String ^ collectionName, cli::array <System::String ^> ^ restrictionValues);
public virtual System.Data.DataTable GetSchema (string collectionName, string[] restrictionValues);
abstract member GetSchema : string * string[] -> System.Data.DataTable
override this.GetSchema : string * string[] -> System.Data.DataTable
Public Overridable Function GetSchema (collectionName As String, restrictionValues As String()) As DataTable

参数

collectionName
String String String String

指定要返回的架构的名称。Specifies the name of the schema to return.

restrictionValues
String[]

为请求的架构指定一组限制值。Specifies a set of restriction values for the requested schema.

返回

一个包含架构信息的 DataTableA DataTable that contains schema information.

异常

collectionName 指定为 null。collectionName is specified as null.

注解

参数可以提供 n 个值深度,这些值由特定集合的限制集合指定。 restrictionValuesThe restrictionValues parameter can supply n depth of values, which are specified by the restrictions collection for a specific collection. 若要设置给定限制的值,而不设置其他限制的值,则需要将前面的限制设置为 null,然后将相应的值放在中,以确定要为其指定值的限制。In order to set values on a given restriction, and not set the values of other restrictions, you need to set the preceding restrictions to null and then put the appropriate value in for the restriction that you would like to specify a value for.

"Tables" 集合就是这样的一个示例。An example of this is the "Tables" collection. 如果 "Tables" 集合具有三个限制(数据库、所有者和表名称),并且您只想返回与 "Carl" 所有者关联的表,则必须至少传递以下值: null、"Carl"。If the "Tables" collection has three restrictions (database, owner, and table name) and you want to get back only the tables associated with the owner "Carl", you must pass in the following values at least: null, "Carl". 如果未传入限制值,则将默认值用于该限制。If a restriction value is not passed in, the default values are used for that restriction. 这与传入 null 的映射相同,后者不同于传入参数值的空字符串。This is the same mapping as passing in null, which is different from passing in an empty string for the parameter value. 在这种情况下,空字符串("")被视为指定参数的值。In that case, the empty string ("") is considered to be the value for the specified parameter.

如果连接与事务相关联,则执行GetSchema调用可能会导致某些提供程序引发异常。If the connection is associated with a transaction, executing GetSchema calls may cause some providers to throw an exception.

另请参阅

适用于