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. General Programming
  3. C#
  4. Deleted records in a dataset

Deleted records in a dataset

Scheduled Pinned Locked Moved C#
helpdatabasequestion
6 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.
  • K Offline
    K Offline
    kmuthuk
    wrote on last edited by
    #1

    Hi I am trying to explain my problem clear enough. I have a dataset DataSet1 which has some data retrieved from the database. I have a copy of DataSet1 called DataSet2. In DataSet2 user are doing some transaction..modifying and deleting rows in a datatable. Now I want to reflect deleted records of DataSet2 in DataSet1. I tried with "Merge", but it reflects only the modified not deleted records. Can anyone help solve this? Thanks in advance Muthu.

    B A 3 Replies Last reply
    0
    • K kmuthuk

      Hi I am trying to explain my problem clear enough. I have a dataset DataSet1 which has some data retrieved from the database. I have a copy of DataSet1 called DataSet2. In DataSet2 user are doing some transaction..modifying and deleting rows in a datatable. Now I want to reflect deleted records of DataSet2 in DataSet1. I tried with "Merge", but it reflects only the modified not deleted records. Can anyone help solve this? Thanks in advance Muthu.

      B Offline
      B Offline
      bobsugar222
      wrote on last edited by
      #2

      You don't need a second copy of the dataset to track the changes yourself. Each row has a RowState property which tracks this so you can validate / undo / whatever

      K 1 Reply Last reply
      0
      • B bobsugar222

        You don't need a second copy of the dataset to track the changes yourself. Each row has a RowState property which tracks this so you can validate / undo / whatever

        K Offline
        K Offline
        kmuthuk
        wrote on last edited by
        #3

        Thats right. But in this case, second dataset is generated by another application. So I need to get modified and deleted details of second dataset. Thanks Muthu.

        1 Reply Last reply
        0
        • K kmuthuk

          Hi I am trying to explain my problem clear enough. I have a dataset DataSet1 which has some data retrieved from the database. I have a copy of DataSet1 called DataSet2. In DataSet2 user are doing some transaction..modifying and deleting rows in a datatable. Now I want to reflect deleted records of DataSet2 in DataSet1. I tried with "Merge", but it reflects only the modified not deleted records. Can anyone help solve this? Thanks in advance Muthu.

          B Offline
          B Offline
          bobsugar222
          wrote on last edited by
          #4

          Are changes being made to dataSet1 while changes are being made to dataSet2 in the other application?

          K 1 Reply Last reply
          0
          • B bobsugar222

            Are changes being made to dataSet1 while changes are being made to dataSet2 in the other application?

            K Offline
            K Offline
            kmuthuk
            wrote on last edited by
            #5

            Yes. Exactly. Second application returns the modified Dataset. I want to find out the deleted records for each datatable without using any loops. Thanks Muthu.

            1 Reply Last reply
            0
            • K kmuthuk

              Hi I am trying to explain my problem clear enough. I have a dataset DataSet1 which has some data retrieved from the database. I have a copy of DataSet1 called DataSet2. In DataSet2 user are doing some transaction..modifying and deleting rows in a datatable. Now I want to reflect deleted records of DataSet2 in DataSet1. I tried with "Merge", but it reflects only the modified not deleted records. Can anyone help solve this? Thanks in advance Muthu.

              A Offline
              A Offline
              Aleksandar Smudja
              wrote on last edited by
              #6

              I am not sure if this is what you want: for (int i = 0; i <= pTable.Rows.Count - 1; i++) { DataRowState rowState = pTable.Rows[i].RowState; if (rowState == DataRowState.Deleted) { //..... } }

              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