views:

25

answers:

2

Can any one help me why this error occurs when i update using sqlDataadapter with join query

Dynamic SQL generation is not supported against multiple base tables.

A: 

You have a "join" in your main query for your dataset (The first one in the TableAdapter with a check by it). You can't automatically generate insert/update/delete logic for a TableAdapter when the main query has multiple tables referenced in the query via a join. The designer isn't smart enough to figure out which table you want to send updates to in that case, that is why you get the error message.

Solution. Ensure that your main query only references the table you want the designer to write insert/update/delete code for. Your secondary queries may reference as many tables as you want.

Carter
A: 

It was in the case that i was trying to set value for identity column in my datarow. Simply i deleted the code to set value for identity column and it will work.

My Scenario:

Database: uin [primary, identity] name address

Whenever i tried to set the datarow("uin") the error occurs. But works fine with datarow("name") and datarow("address").

Hope it works for you too

KoolKabin

related questions