Results 1 to 3 of 3

Thread: Refreshing a DataSet

  1. #1

    Thread Starter
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690

    Refreshing a DataSet

    Searched for this, but could not find.

    I have a windows form with data bound controls. Typical first, next, last etc buttons to move through the records. User can create a record and update the DB, via dataadapter.update.

    Wondering what is the preferred method of updating the client's view? For example, I'm displaying an identity colum and need the database-created value.

    Just fill the dataset again with the same table name after re-populating the dataadapter? Somehow truncate the table in the dataset first? Any thoughts appreciated.

    Mike

  2. #2
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    You can probably just fill the dataset again then bind it again to the controls.
    Dont gain the world and lose your soul

  3. #3

    Thread Starter
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690
    Not sure if this is the best method, but it seems to work. If you call the dataadapter.fill on a table that's already in the dataset, the information appends to the dataset's table, so it looks like you have to clear it first.

    So I cleared it, got the data again, filled the dataset, then moved to the row I just created.

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