Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. dataset getchanges() question

dataset getchanges() question

Scheduled Pinned Locked Moved Database
questionannouncement
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    NikoTanghe
    wrote on last edited by
    #1

    GetChanges() returns nothing here, right after a row is deleted. and there is actually 1 row removed from the dataset, how is this possible? dsCustomers.GetChanges() gives the same results. dsCustomers.Tables(0).Rows.Remove(dsCustomers.Tables(0).Rows(cm.Position)) Dim DataSetDeleted As DataSet = dsCustomers.GetChanges(DataRowState.Deleted) If Not DataSetDeleted Is Nothing Then daCustomers.Update(DataSetDeleted) dsCustomers.AcceptChanges() End If

    J 1 Reply Last reply
    0
    • N NikoTanghe

      GetChanges() returns nothing here, right after a row is deleted. and there is actually 1 row removed from the dataset, how is this possible? dsCustomers.GetChanges() gives the same results. dsCustomers.Tables(0).Rows.Remove(dsCustomers.Tables(0).Rows(cm.Position)) Dim DataSetDeleted As DataSet = dsCustomers.GetChanges(DataRowState.Deleted) If Not DataSetDeleted Is Nothing Then daCustomers.Update(DataSetDeleted) dsCustomers.AcceptChanges() End If

      J Offline
      J Offline
      jonathan15
      wrote on last edited by
      #2

      From what i understand you need to call the delete method of the datarow. Calling the remove method removes the row entirely (it is gone and the rowcount is reduced). When you call the getchanges method with the deleted parameter it looks for rows marked as deleted. as you have used remove there are no rows that fit this description. If you call the delete method it simply marks the row as deleted. GetChanges with then report that row as deleted and you can call an update. Jonathan

      M 1 Reply Last reply
      0
      • J jonathan15

        From what i understand you need to call the delete method of the datarow. Calling the remove method removes the row entirely (it is gone and the rowcount is reduced). When you call the getchanges method with the deleted parameter it looks for rows marked as deleted. as you have used remove there are no rows that fit this description. If you call the delete method it simply marks the row as deleted. GetChanges with then report that row as deleted and you can call an update. Jonathan

        M Offline
        M Offline
        miah alom
        wrote on last edited by
        #3

        Agreed. Please call DataRow.Delete() instead.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups