Thread: Updating a datarow in a datset

  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    21

    Updating a datarow in a datset

    Hi,

    I have an existing set of data in SQL which I am referencing as a DataSet object. I want to update some of the fields on one of the rows based on the info that is entered into a form.

    I have already set up the form so that it displays the fields of the row in question in a number of text boxes. When you click a check box it allows you to ammend certain fields. This is the information that I want to send back to the database.

    Should i be removing the old row and trying to insert the ammendments as new tow (with the same Id) or using a stored proc?

    Any ideas welcome.

  2. #2
    ...and never returned. StainedBlue's Avatar
    Join Date
    Aug 2009
    Posts
    168
    So only one row can be edited at a time? I assume you're not using GridView.
    Do you need the DataSet to be updated, and then use the DataSet to update your SqlDb? Or can you just update the SqlDb directly?

    There's several ways to go about this type of functionality, but the best approach depends on your requirements. A little more info might help some of us steer you in the best direction.

    >>Should i be removing the old row and trying to insert the ammendments as new tow (with the same Id) or using a stored proc?

    You can update any cell in the DataSet directly. There's no need to remove and insert new rows.

  3. #3
    Registered User
    Join Date
    Jun 2009
    Posts
    21
    Thanks for the reply.

    I sorted this out a while ago. I think I was forgetting to directly reference the correct row in the dataset or something like that.

    Anyway it's all working fine now

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WM_Paint not updating using GDI
    By zidsal in forum Windows Programming
    Replies: 3
    Last Post: 07-25-2008, 05:05 AM
  2. Updating a datarow in dataset
    By osal in forum C# Programming
    Replies: 2
    Last Post: 08-08-2005, 03:13 PM
  3. file processing updating record error
    By uuser in forum C Programming
    Replies: 2
    Last Post: 04-27-2003, 12:13 AM
  4. continuously updating timer on console display
    By revelation437 in forum C++ Programming
    Replies: 5
    Last Post: 02-24-2003, 12:28 PM
  5. Updating a file
    By Unregistered in forum C Programming
    Replies: 1
    Last Post: 05-29-2002, 03:03 AM