SqlConnection.GetSchemaAsync Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Overload
| Nome | Descrizione |
|---|---|
| GetSchemaAsync(CancellationToken) |
Versione asincrona di GetSchema(), che restituisce informazioni sullo schema per l'origine dati di questo SqlConnectionoggetto . Per altre informazioni sugli schemi, vedere SQL Server Raccolte di schemi. |
| GetSchemaAsync(String, CancellationToken) |
Versione asincrona di GetSchema(String), che restituisce informazioni sullo schema per l'origine dati di questo SqlConnection oggetto utilizzando la stringa specificata per il nome dello schema. |
| GetSchemaAsync(String, String[], CancellationToken) |
Versione asincrona di GetSchema(String, String[]), che restituisce informazioni sullo schema per l'origine dati di questo SqlConnection oggetto utilizzando la stringa specificata per il nome dello schema e la matrice di stringhe specificata per i valori di restrizione. |
GetSchemaAsync(CancellationToken)
Versione asincrona di GetSchema(), che restituisce informazioni sullo schema per l'origine dati di questo SqlConnectionoggetto . Per altre informazioni sugli schemi, vedere SQL Server Raccolte di schemi.
public System.Threading.Tasks.Task<System.Data.DataTable> GetSchemaAsync(System.Threading.CancellationToken cancellationToken = default);
public override System.Threading.Tasks.Task<System.Data.DataTable> GetSchemaAsync(System.Threading.CancellationToken cancellationToken = default);
member this.GetSchemaAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Data.DataTable>
override this.GetSchemaAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Data.DataTable>
Public Function GetSchemaAsync (Optional cancellationToken As CancellationToken = Nothing) As Task(Of DataTable)
Public Overrides Function GetSchemaAsync (Optional cancellationToken As CancellationToken = Nothing) As Task(Of DataTable)
Parametri
- cancellationToken
- CancellationToken
Token di annullamento.
Valori restituiti
Attività che rappresenta l'operazione asincrona.
Commenti
Per altre informazioni sulla programmazione asincrona nel provider di dati framework di .NET per SQL Server, vedere Asynchronous Programming.
Si applica a
GetSchemaAsync(String, CancellationToken)
Versione asincrona di GetSchema(String), che restituisce informazioni sullo schema per l'origine dati di questo SqlConnection oggetto utilizzando la stringa specificata per il nome dello schema.
public System.Threading.Tasks.Task<System.Data.DataTable> GetSchemaAsync(string collectionName, System.Threading.CancellationToken cancellationToken = default);
public override System.Threading.Tasks.Task<System.Data.DataTable> GetSchemaAsync(string collectionName, System.Threading.CancellationToken cancellationToken = default);
member this.GetSchemaAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Data.DataTable>
override this.GetSchemaAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Data.DataTable>
Public Function GetSchemaAsync (collectionName As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of DataTable)
Public Overrides Function GetSchemaAsync (collectionName As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of DataTable)
Parametri
- collectionName
- String
Specifica il nome dello schema da restituire.
- cancellationToken
- CancellationToken
Token di annullamento.
Valori restituiti
Attività che rappresenta l'operazione asincrona.
Eccezioni
collectionName è specificato come Null.
Commenti
Per altre informazioni sulla programmazione asincrona nel provider di dati framework di .NET per SQL Server, vedere Asynchronous Programming.
Si applica a
GetSchemaAsync(String, String[], CancellationToken)
Versione asincrona di GetSchema(String, String[]), che restituisce informazioni sullo schema per l'origine dati di questo SqlConnection oggetto utilizzando la stringa specificata per il nome dello schema e la matrice di stringhe specificata per i valori di restrizione.
public System.Threading.Tasks.Task<System.Data.DataTable> GetSchemaAsync(string collectionName, string[] restrictionValues, System.Threading.CancellationToken cancellationToken = default);
public override System.Threading.Tasks.Task<System.Data.DataTable> GetSchemaAsync(string collectionName, string[] restrictionValues, System.Threading.CancellationToken cancellationToken = default);
member this.GetSchemaAsync : string * string[] * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Data.DataTable>
override this.GetSchemaAsync : string * string[] * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Data.DataTable>
Public Function GetSchemaAsync (collectionName As String, restrictionValues As String(), Optional cancellationToken As CancellationToken = Nothing) As Task(Of DataTable)
Public Overrides Function GetSchemaAsync (collectionName As String, restrictionValues As String(), Optional cancellationToken As CancellationToken = Nothing) As Task(Of DataTable)
Parametri
- collectionName
- String
Specifica il nome dello schema da restituire.
- restrictionValues
- String[]
Set di valori di restrizione per lo schema richiesto.
- cancellationToken
- CancellationToken
Token di annullamento.
Valori restituiti
Attività che rappresenta l'operazione asincrona.
Eccezioni
collectionName è specificato come Null.
Commenti
Il restrictionValues parametro può fornire n profondità di valori, specificati dalla raccolta di restrizioni per una raccolta specifica. Per impostare i valori per una determinata restrizione e non impostare i valori di altre restrizioni, è necessario impostare le restrizioni precedenti su null e quindi inserire il valore appropriato in per la restrizione per cui si vuole specificare un valore.
Un esempio è l'insieme "Tables". Se l'insieme "Tables" ha tre restrizioni:-database, proprietario e nome tabella- e si desidera recuperare solo le tabelle associate al proprietario "Carl", è necessario passare i valori seguenti: null, "Carl". Se non viene passato un valore di restrizione, per tale restrizione vengono usati i valori predefiniti. Si tratta dello stesso mapping del passaggio di null, che è diverso dal passaggio di una stringa vuota per il valore del parametro. In tal caso, la stringa vuota ("") viene considerata il valore per il parametro specificato.