DataAdapter.MissingSchemaAction DataAdapter.MissingSchemaAction DataAdapter.MissingSchemaAction DataAdapter.MissingSchemaAction Property

Définition

Détermine l’action à entreprendre lorsque le schéma DataSet schéma ne correspond pas aux données entrantes.Determines the action to take when existing DataSet schema does not match incoming data.

public:
 property System::Data::MissingSchemaAction MissingSchemaAction { System::Data::MissingSchemaAction get(); void set(System::Data::MissingSchemaAction value); };
[System.Data.DataSysDescription("DataAdapter_MissingSchemaAction")]
public System.Data.MissingSchemaAction MissingSchemaAction { get; set; }
member this.MissingSchemaAction : System.Data.MissingSchemaAction with get, set
Public Property MissingSchemaAction As MissingSchemaAction

Valeur de propriété

Une des valeurs de MissingSchemaAction.One of the MissingSchemaAction values. La valeur par défaut est Add.The default is Add.

Implémente

Exceptions

La valeur définie ne fait pas partie de la MissingSchemaAction valeurs.The value set is not one of the MissingSchemaAction values.

Exemples

L’exemple suivant crée une classe dérivée, OleDbDataAdapter et définit certaines de ses propriétés.The following example creates a derived class, OleDbDataAdapter and sets some of its properties.

// Assumes a valid connection string to an Access database.
static void CreateOleDbAdapter(string connectionString)
{
    OleDbDataAdapter adapter = new OleDbDataAdapter();
    adapter.SelectCommand =
        new OleDbCommand("SELECT * FROM Categories ORDER BY CategoryID");
    adapter.SelectCommand.Connection =
        new OleDbConnection(connectionString);
    adapter.MissingMappingAction = MissingMappingAction.Error;
    adapter.MissingSchemaAction = MissingSchemaAction.Error;
}
' Assumes a valid connection string to an Access database.
Private Sub CreateOleDbDataAdapter(ByVal connectionString As String)
    Dim adapter As New OleDbDataAdapter()
    adapter.SelectCommand = _
       New OleDbCommand("SELECT * FROM Categories ORDER BY CategoryID")
    adapter.SelectCommand.Connection = New OleDbConnection _
       (connectionString)
    adapter.MissingMappingAction = MissingMappingAction.Error
    adapter.MissingSchemaAction = MissingSchemaAction.Error
End Sub

S’applique à

Voir aussi