Export (0) Print
Expand All

DataAdapter.MissingMappingAction Property

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

[Visual Basic]
Public Overridable Property MissingMappingAction As _
   MissingMappingAction  Implements _
   IDataAdapter.MissingMappingAction
[C#]
public virtual MissingMappingAction MissingMappingAction {get;
   set;}
[C++]
public: __property virtual MissingMappingAction get_MissingMappingAction();
public: __property virtual void set_MissingMappingAction(MissingMappingAction);
[JScript]
public function get MissingMappingAction() : MissingMappingAction;
public function set MissingMappingAction(MissingMappingAction);

Property Value

One of the MissingMappingAction values. The default is Passthrough.

Implements

IDataAdapter.MissingMappingAction

Exceptions

Exception Type Condition
ArgumentException The value set is not one of the MissingMappingAction values.

Remarks

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

Example

[Visual Basic, C#, C++] The following example creates a derived class, OleDbDataAdapter and sets some of its properties.

[Visual Basic] 
Public Sub CreateOleDbDataAdapter()
    Dim myDataAdapter As New OleDbDataAdapter()
    myDataAdapter.SelectCommand = _
       New OleDbCommand("SELECT * FROM Categories ORDER BY CategoryID")
    myDataAdapter.SelectCommand.Connection = New OleDbConnection _
       ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=NWIND_RW.MDB")
    myDataAdapter.MissingMappingAction = MissingMappingAction.Error
    myDataAdapter.MissingSchemaAction = MissingSchemaAction.Error
End Sub

[C#] 
public void CreateOleDbDataAdapter () {
   OleDbDataAdapter myDataAdapter = new OleDbDataAdapter();
   myDataAdapter.SelectCommand =
      new OleDbCommand("SELECT * FROM Categories ORDER BY CategoryID");
   myDataAdapter.SelectCommand.Connection =
      new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=NWIND_RW.MDB");
   myDataAdapter.MissingMappingAction = MissingMappingAction.Error;
   myDataAdapter.MissingSchemaAction = MissingSchemaAction.Error;
}

[C++] 
void CreateOleDbDataAdapter () {
   OleDbDataAdapter* myDataAdapter = new OleDbDataAdapter;
   myDataAdapter->SelectCommand =
      new OleDbCommand(S"SELECT * FROM Categories ORDER BY CategoryID");
   myDataAdapter->SelectCommand->Connection =
      new OleDbConnection(S"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=NWIND_RW.MDB");
   myDataAdapter->MissingMappingAction = MissingMappingAction::Error;
   myDataAdapter->MissingSchemaAction = MissingSchemaAction::Error;
}

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

DataAdapter Class | DataAdapter Members | System.Data.Common Namespace | MissingSchemaAction

Show:
© 2014 Microsoft