次の方法で共有


DataAdapter.MissingSchemaAction プロパティ

定義

既存の DataSet スキーマが受信データと一致しないときに実行するアクションを決定します。

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

プロパティ値

MissingSchemaAction 値のいずれか 1 つ。 既定値は、Add です。

実装

属性

例外

設定された値が MissingSchemaAction 値の 1 つではありません。

次の例では、派生クラスを作成し、 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

適用対象

こちらもご覧ください