DataTableMapping.GetDataTableBySchemaAction Méthode

Définition

Obtient le DataTable en cours pour le DataSet spécifié à l'aide de la valeur MissingSchemaAction spécifiée.

public:
 System::Data::DataTable ^ GetDataTableBySchemaAction(System::Data::DataSet ^ dataSet, System::Data::MissingSchemaAction schemaAction);
public System.Data.DataTable? GetDataTableBySchemaAction (System.Data.DataSet dataSet, System.Data.MissingSchemaAction schemaAction);
public System.Data.DataTable GetDataTableBySchemaAction (System.Data.DataSet dataSet, System.Data.MissingSchemaAction schemaAction);
member this.GetDataTableBySchemaAction : System.Data.DataSet * System.Data.MissingSchemaAction -> System.Data.DataTable
Public Function GetDataTableBySchemaAction (dataSet As DataSet, schemaAction As MissingSchemaAction) As DataTable

Paramètres

dataSet
DataSet

DataSet à partir de laquelle obtenir DataTable.

schemaAction
MissingSchemaAction

Une des valeurs de l'objet MissingSchemaAction.

Retours

Tables de données.

Exemples

L’exemple suivant obtient le DataTable pour un donné DataSet. S’il n’existe aucune table actuelle pour le DataSet, null est retourné. Cet exemple suppose qu’une DataSet collection et une DataTableMappingCollection collection ont été créées.

public void CreateDataTable()
{
    // ...
    // create dataSet and mapping
    // ...
    DataTable table = mapping.GetDataTableBySchemaAction
        (dataSet, MissingSchemaAction.Ignore);
}
Public Sub CreateDataTable()
    ' ...
    ' create dataSet and mapping
    ' ...
    Dim table As DataTable = mapping.GetDataTableBySchemaAction _
       (dataSet, MissingSchemaAction.Ignore)
End Sub

Remarques

Si le n’existe DataTable pas, le spécifié MissingSchemaAction est pris.

S’applique à

Voir aussi