DataAdapter.MissingMappingAction Properti
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Menentukan tindakan yang harus diambil saat data masuk tidak memiliki tabel atau kolom yang cocok.
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
Nilai Properti
Salah MissingMappingAction satu nilai. Default adalah Passthrough
.
Penerapan
- Atribut
Pengecualian
Kumpulan nilai bukan salah MissingMappingAction satu nilai.
Contoh
Contoh berikut membuat kelas turunan, OleDbDataAdapter dan menetapkan beberapa propertinya.
// 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
Keterangan
Properti TableMappings menyediakan pemetaan utama antara rekaman yang dikembalikan dan DataSet.