Results 1 to 4 of 4

Thread: DataAdapter Update method

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    May 2001
    Posts
    837

    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.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    May 2001
    Posts
    837

    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.

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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
  •  



Click Here to Expand Forum to Full Width