System.Data Namespace IDataAdapter Class
Sets or retrieves the action to take when existing DataSet schema does not match incoming data.
Script |
IDataAdapter.MissingSchemaAction [ = enumValue ] |
The property is read/write with a default value of Add.
The MissingSchemaAction property specifies or determines whether missing source tables, columns, and their relationships are added to the data set schema, ignored, or cause an error to be raised.
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 MissingMappingAction