DataAdapter.MissingMappingAction 属性

定义

确定传入数据没有匹配的表或列时需要执行的操作。

public:
 property System::Data::MissingMappingAction MissingMappingAction { System::Data::MissingMappingAction get(); void set(System::Data::MissingMappingAction value); };
public System.Data.MissingMappingAction MissingMappingAction { get; set; }
[System.Data.DataSysDescription("DataAdapter_MissingMappingAction")]
public System.Data.MissingMappingAction MissingMappingAction { get; set; }
member this.MissingMappingAction : System.Data.MissingMappingAction with get, set
[<System.Data.DataSysDescription("DataAdapter_MissingMappingAction")>]
member this.MissingMappingAction : System.Data.MissingMappingAction with get, set
Public Property MissingMappingAction As MissingMappingAction

属性值

MissingMappingAction 值之一。 默认值为 Passthrough

实现

属性

例外

设置的值不是 MissingMappingAction 值之一。

示例

以下示例创建一个派生类, OleDbDataAdapter 并设置其一些属性。

// 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;
}
' 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 _
       (connectionString)
    adapter.MissingMappingAction = MissingMappingAction.Error
    adapter.MissingSchemaAction = MissingSchemaAction.Error
End Sub

注解

属性 TableMappings 提供返回的记录与 DataSet之间的主映射。

适用于

另请参阅