Data Adapter Wizard

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want the data adapter wizard to automatically generate update, insert,
and delete statements from a given select statement if the select statement
is a multiple table query. I know this works with single table select statements.
Does anyone know how to make this possible with multiple table select statments

Thanks
Parveen
 
Well the Data Adapter when using inline SQL statements can only support one table to perform CRUD operations against. The reasons for this are first the Data Adapter can only accept one Command object per CRUD operation (InsertCommand, UpdateCommand, and DeleteCommand). So you can only act on one table at a time. Another thing to think about in a normalized database if you were going to update multiple tables you would have to handle parent-child relationships, which a data adapter can not handle. You could create multiple data adapters, and have them perform fills, and updates on a single dataset

Keenan Newton
 
Well no because to my knowledge there is not a way to tell the wizard which table in a multiple table query to update, however what you could do is create another data adapter that would simply be a select statement from the table you want to update. Then use this dataadapter to perform your updates. This isn't the best solution but it will get the job done. the wizard are great as a learning tool, but for more complex tasks you may want to go ahead and write your own command objects, and plug those into your data adapter

Keenan Newton
 
Back
Top