J
Jim Rand
In VS 2005, table adapters are used as wrappers to underlying data adapters.
Dragging the tables onto the dataset designer surface automatically creates
table adapters.
Unlike the data adapter, the table adapter throws no events such FillError,
RowUpdated or RowUpdating.
In VS 2003, you needed to trap inserted rows for a GetChanges() dataset
using an event handler like:
private void sqlDACustomer_RowUpdated(object sender,
System.Data.SqlClient.SqlRowUpdatedEventArgs e)
{
if (e.StatementType == StatementType.Insert) e.Status =
UpdateStatus.SkipCurrentRow;
}
What are my options?
1) Not drag tables onto the designer to avoid getting table adapters? That's
a pain because you have to write a small program to get the underlying table
structure from the database into a dataset and then write an xsd to be
imported into VS 2005.
2) Copy and paste from TableAdapter.InitAdapter to my own class to create a
data adapter.
3) Burrow into the TableAdapter through reflection to bypass the private
modifier.
private System.Data.SqlClient.SqlDataAdapter Adapter {
Your thoughts
Thanks
Dragging the tables onto the dataset designer surface automatically creates
table adapters.
Unlike the data adapter, the table adapter throws no events such FillError,
RowUpdated or RowUpdating.
In VS 2003, you needed to trap inserted rows for a GetChanges() dataset
using an event handler like:
private void sqlDACustomer_RowUpdated(object sender,
System.Data.SqlClient.SqlRowUpdatedEventArgs e)
{
if (e.StatementType == StatementType.Insert) e.Status =
UpdateStatus.SkipCurrentRow;
}
What are my options?
1) Not drag tables onto the designer to avoid getting table adapters? That's
a pain because you have to write a small program to get the underlying table
structure from the database into a dataset and then write an xsd to be
imported into VS 2005.
2) Copy and paste from TableAdapter.InitAdapter to my own class to create a
data adapter.
3) Burrow into the TableAdapter through reflection to bypass the private
modifier.
private System.Data.SqlClient.SqlDataAdapter Adapter {
Your thoughts
Thanks