Configure Data Adapter problem

G

Guest

I receive the following message after

'Generated INSERT statement'
'Generated UPDATE statement'
'Generated DELETE statement'

"The original query has a select list that has columns from multiple tables.
The statement cannot be generated automatically for this type of query."

Here's my Oracle databse query:

select car_master.car_id,
car_master.year,car_master.vehicle,car_detail.car_id AS EXPR1,
car_detail.price,car_detail.mileage,car_detail.body,car_detail.body FROM
car_master,car_detail where car_master.car_id=car_detail.car_id;

Any suggestions would be appreciated.

Thanks.

bebop
 
M

Marina

Your FROM has more then one table in it. The command builder (and the wizard
in VS.NET) does not support that because in theory you could be selecting
column from different tables, and updating them. Then it has to update all
the rows from different table, and it has no way of figuring out which row
because of the joins.

If you want to use a command builder at run time, you can change the SELECT
statement on the adapter prior to creating the command builder to be just
from the table you want to update to, and only include the columns that
belong to that table. That should work ok.

If you are using the wizard, then my suggestion would be to never ever use
it.
 
W

W.G. Ryan MVP

Like Marina mentions, none of the tools that autogenerate CRUD logic can
generate all 4 commands if you use a JOIN. Your best bet is to fire
multiple queries and use then use a DataRelation between the tables in a
dataset to maintain integrity.
 

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