DbConnection.GetSchema Método
Definição
Retorna informações de esquema para a fonte de dados deste DbConnection.Returns schema information for the data source of this DbConnection.
Sobrecargas
| GetSchema() |
Retorna informações de esquema para a fonte de dados deste DbConnection.Returns schema information for the data source of this DbConnection. |
| GetSchema(String) |
Retorna informações de esquema para a fonte de dados deste DbConnection usando a cadeia de caracteres especificada para o nome do esquema.Returns schema information for the data source of this DbConnection using the specified string for the schema name. |
| GetSchema(String, String[]) |
Retorna informações de esquema para a fonte de dados desse DbConnection usando a cadeia de caracteres especificada para o nome do esquema e a matriz de cadeia de caracteres especificada para os valores de restrição.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. |
Comentários
Se a conexão estiver associada a uma transação, a execução de GetSchema chamadas poderá fazer com que alguns provedores gerem uma exceção.If the connection is associated with a transaction, executing GetSchema calls may cause some providers to throw an exception.
GetSchema()
Retorna informações de esquema para a fonte de dados deste 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
Retornos
Um DataTable que contém informações de esquema.A DataTable that contains schema information.
Comentários
Se a conexão estiver associada a uma transação, a execução de GetSchema chamadas poderá fazer com que alguns provedores gerem uma exceção.If the connection is associated with a transaction, executing GetSchema calls may cause some providers to throw an exception.
Aplica-se a
GetSchema(String)
Retorna informações de esquema para a fonte de dados deste DbConnection usando a cadeia de caracteres especificada para o nome do esquema.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
Parâmetros
- collectionName
- String
Especifica o nome do esquema a retornar.Specifies the name of the schema to return.
Retornos
Um DataTable que contém informações de esquema.A DataTable that contains schema information.
Exceções
collectionName é especificado como nulo.collectionName is specified as null.
Comentários
Se a conexão estiver associada a uma transação, a execução de GetSchema chamadas poderá fazer com que alguns provedores gerem uma exceção.If the connection is associated with a transaction, executing GetSchema calls may cause some providers to throw an exception.
Aplica-se a
GetSchema(String, String[])
Retorna informações de esquema para a fonte de dados desse DbConnection usando a cadeia de caracteres especificada para o nome do esquema e a matriz de cadeia de caracteres especificada para os valores de restrição.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);
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
Parâmetros
- collectionName
- String
Especifica o nome do esquema a retornar.Specifies the name of the schema to return.
- restrictionValues
- String[]
Especifica um conjunto de valores de restrição do esquema solicitado.Specifies a set of restriction values for the requested schema.
Retornos
Um DataTable que contém informações de esquema.A DataTable that contains schema information.
Exceções
collectionName é especificado como nulo.collectionName is specified as null.
Comentários
O restrictionValues parâmetro pode fornecer n profundidade de valores, que são especificados pela coleção de restrições para uma coleção específica.The restrictionValues parameter can supply n depth of values, which are specified by the restrictions collection for a specific collection. Para definir valores em uma determinada restrição e não definir os valores de outras restrições, você precisa definir as restrições anteriores como NULL e, em seguida, colocar o valor apropriado em para a restrição para a qual você gostaria de especificar um valor.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.
Um exemplo disso é a coleção "Tables".An example of this is the "Tables" collection. Se a coleção "Tables" tiver três restrições (banco de dados, proprietário e nome de tabela) e você quiser obter apenas as tabelas associadas ao proprietário "Carl", você deverá passar os seguintes valores pelo menos: 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". Se um valor de restrição não for passado, os valores padrão serão usados para essa restrição.If a restriction value is not passed in, the default values are used for that restriction. Esse é o mesmo mapeamento que passar em NULL, que é diferente de passar uma cadeia de caracteres vazia para o valor do parâmetro.This is the same mapping as passing in null, which is different from passing in an empty string for the parameter value. Nesse caso, a cadeia de caracteres vazia ("") é considerada como o valor para o parâmetro especificado.In that case, the empty string ("") is considered to be the value for the specified parameter.
Se a conexão estiver associada a uma transação, a execução de GetSchema chamadas poderá fazer com que alguns provedores gerem uma exceção.If the connection is associated with a transaction, executing GetSchema calls may cause some providers to throw an exception.