|
-
Mar 9th, 2006, 03:59 PM
#1
Thread Starter
Fanatic Member
DataAdapter Update method
If the DataAdapter can use table mappings to correctly fill a dataset using a Command object that returns multiple result sets, why can't the same (single) Adapter, given manually created insert, update, and delete commands, be used to update that data?
I'm running out of time to write this, I'll be back later if I didn't explain it right. I'm speaking of many-to-many relationships, where you want to insert a parent record and also want to insert the record in the "bridge" table.
The command object takes a parameter name and source column, so why can't the adapter match that up with the TableMappings to provide the parameters for an insert command?
The human brain cannot hold all of the knowledge that exists in this world, but it can hold pointers to that knowledge.
-
Mar 12th, 2006, 05:38 AM
#2
Re: DataAdapter Update method
They haven't given a reason for it, but they have mentioned that it is a limitation. Only unmapped and unrelated tables allowed.
-
Mar 12th, 2006, 04:22 PM
#3
Thread Starter
Fanatic Member
Re: DataAdapter Update method
Would it be easy enough to derive my own DataAdapter that did that?
The human brain cannot hold all of the knowledge that exists in this world, but it can hold pointers to that knowledge.
-
Mar 13th, 2006, 11:08 AM
#4
Re: DataAdapter Update method
I have not gotten into this. I am now thinking about it, and yes, it's quite possible. You could do this... what are the bits of information you need from the dataset?
The tables, obviously.
The primary keys, fine.
The relationshps between the table, including the foreignkey/primarykey
The rows which have changed, easy.
I am not sure why nobody has attempted this yet, but it might be because of two things
A) Most people use SPs. They send the data to the SP, and the SP updates the tables.
B) Microsoft has told us sheep that you should use a different adapter for each table and update the tables in the right order.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|