MissingMappingAction Property

DataAdapter.MissingMappingAction Property


Determines the action to take when incoming data does not have a matching table or column.

Namespace:   System.Data.Common
Assembly:  System.Data (in System.Data.dll)

public MissingMappingAction MissingMappingAction { get; set; }

Property Value

Type: System.Data.MissingMappingAction

One of the MissingMappingAction values. The default is Passthrough.

Exception Condition

The value set is not one of the MissingMappingAction values.

The TableMappings property provides the master mapping between the returned records and the DataSet.

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;

.NET Framework
Available since 1.1
Return to top
© 2015 Microsoft