System.Data Namespace IDataAdapter Class
Sets or retrieves the action to take when incoming data does not have a matching table or column.
Script |
IDataAdapter.MissingMappingAction [ = enumValue ] |
The property is read/write with a default value of Passthrough.
The MissingMappingAction property specifies or determines whether unmapped source tables or columns are passed with their source names in order to be filtered, or to raise an error.
The TableMappings property provides the master mapping between the returned records and the DataSet.
The following example initializes a derived class, an SqlDataAdapter, and sets some of its properties.
SqlDataAdapter myAdapter = new SqlDataAdapter ( );
myAdapter.SelectCommand.CommandText = "SELECT * FROM pubs_Titles";
myAdapter.SelectCommand.Connection = new SqlConnection (
"server=localhost; trusted_connection=yes; database=pubs" );
myAdapter.MissingMappingAction = MissingMappingAction.Error;
myAdapter.MissingSchemaAction = MissingSchemaAction.Error;
Dim myAdapter As New SqlDataAdapter ( )
myAdapter.SelectCommand.CommandText = "SELECT * FROM pubs_Titles"
myAdapter.SelectCommand.Connection = New SqlConnection ( _
"server=localhost; trusted_connection=yes; database=pubs" )
myAdapter.MissingMappingAction = MissingMappingAction.Error
myAdapter.MissingSchemaAction = MissingSchemaAction.Error |
|
C# |
VB |
IDataAdapter Members MissingSchemaAction