Data Adapter Wizard


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
 
Ad

Advertisements

G

Guest

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
 
Ad

Advertisements

G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top