DataAdapter.MissingSchemaAction Property


Determines the action to take when existing DataSet schema does not match incoming data.

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

Public Property MissingSchemaAction As MissingSchemaAction

Property Value

Type: System.Data.MissingSchemaAction

One of the MissingSchemaAction values. The default is Add.

Exception Condition

The value set is not one of the MissingSchemaAction values.

The following example creates a derived class, OleDbDataAdapter and sets some of its properties.

' 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 _
    adapter.MissingMappingAction = MissingMappingAction.Error
    adapter.MissingSchemaAction = MissingSchemaAction.Error
End Sub

.NET Framework
Available since 1.1
Return to top