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. Visual Basic
  4. row state is always set to modified

row state is always set to modified

Scheduled Pinned Locked Moved Visual Basic
help
4 Posts 2 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
    kowplunk
    wrote on last edited by
    #1

    I am trying to only submit the certain rows from the dataTable that have been modifed with 2 ways to which both of them result in all the rows being submitted. The first way is using the GetChanged method of the dataTable, and it returns all the rows. The second way is using the if myRow.RowState = DataRowState.Modified, and it says they were all modified. I tried to insert this before the fill operation: .AcceptChangesDuringFill = True after having problems, assuming that it was during the fill that the rowState was set to modifed, but no luck. I have also tried after inserting the data into the table: myTable.AcceptChanges. I am pretty sure that nothing else touches the rows after that so they should not get there rowStatus changed. If anyone can see what I am doing wrong, or leaving out I would appreciate the help. Thanks

    U 1 Reply Last reply
    0
    • K kowplunk

      I am trying to only submit the certain rows from the dataTable that have been modifed with 2 ways to which both of them result in all the rows being submitted. The first way is using the GetChanged method of the dataTable, and it returns all the rows. The second way is using the if myRow.RowState = DataRowState.Modified, and it says they were all modified. I tried to insert this before the fill operation: .AcceptChangesDuringFill = True after having problems, assuming that it was during the fill that the rowState was set to modifed, but no luck. I have also tried after inserting the data into the table: myTable.AcceptChanges. I am pretty sure that nothing else touches the rows after that so they should not get there rowStatus changed. If anyone can see what I am doing wrong, or leaving out I would appreciate the help. Thanks

      U Offline
      U Offline
      User 530381
      wrote on last edited by
      #2

      It seems that you are doing something wrong in your code. I have just tried that on my computer and GetChanges() is working just fine. I tried something like this Me.DataGrid1.DataSource = Me.Dataset11.authors.GetChanges(DataRowState.Modified) and the GetChanges() returned only the rows that I modified Give me some more of your code if you like and I might find the solution. Better luck next time sony speed

      K 1 Reply Last reply
      0
      • U User 530381

        It seems that you are doing something wrong in your code. I have just tried that on my computer and GetChanges() is working just fine. I tried something like this Me.DataGrid1.DataSource = Me.Dataset11.authors.GetChanges(DataRowState.Modified) and the GetChanges() returned only the rows that I modified Give me some more of your code if you like and I might find the solution. Better luck next time sony speed

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

        thanks for the help. What seemed to be the problem was that initially I didn't have the acceptChanges() in there and after I inserted it I forgot that I had another method that was stipping out all the null values and that was making chnages once again. All is gooood now.

        K 1 Reply Last reply
        0
        • K kowplunk

          thanks for the help. What seemed to be the problem was that initially I didn't have the acceptChanges() in there and after I inserted it I forgot that I had another method that was stipping out all the null values and that was making chnages once again. All is gooood now.

          K Offline
          K Offline
          kowplunk
          wrote on last edited by
          #4

          I am having a hard time getting the getChanges to retrieve the changes that were performed on the last row of the data. Since the user is not able to create rows, nothing really happens when the hit the enter key on the last line. I suppose I could always have an extra blank row at the bottom of the grid, but is there a better way to deal with this?

          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