update method failing

Results 1 to 2 of 2

Thread: update method failing

  1. #1
    Join Date
    Dec 1969

    Default update method failing

    Hi,<BR><BR>What am I doing wrong here? The code goes through OK, but now rows are added to the "archive" table in the database. I&#039;m pretty sure i&#039;m using update wrong .. after all "archive" is a table in the dataset, not the database, but I presumed update would update the database from which the table was drawn.<BR><BR><BR> If ds.Tables("archive").Rows.Count = 0 Then<BR> &#039;archive data is empty. Add row<BR> ds.Tables("archive").ImportRow(ds.Tables("current" ).Rows(0))<BR> Else<BR> &#039;archive exists. Update row<BR> Dim thing = "DELETE FROM pwp_archive WHERE networkID LIKE &#039;" & strUser & "&#039;"<BR> Dim stuff = New SqlCommand(thing, cn)<BR> objCommand.ExecuteNonQuery()<BR><BR> ds.Tables("archive").ImportRow(ds.Tables("current" ).Rows(0))<BR> End If<BR> adp.Update(ds, "archive")<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: update method failing

    Well I dont normally run my updates this way but I see no one else took a shot at it so here is my bit of help. There is something you need to do to get your changes in the dataset to push back to the database. Just changing the dataset wont actually do it. I have no idea what that command is though.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts