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. LINQ
  4. Deleting then selecting from a dataset using linq to dataset

Deleting then selecting from a dataset using linq to dataset

Scheduled Pinned Locked Moved LINQ
csharpdatabaselinqhelpquestion
3 Posts 3 Posters 3 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.
  • M Offline
    M Offline
    Mohamed El Gohary
    wrote on last edited by
    #1

    I try to remove an item from a DataSet using DataRow.Delete(), then I try to do a linq query operation to select from the same table. I always get an exception because the deleted rows cannot be accessed. "Deleted row information cannot be accessed through the row." Is there a way to overcome this error while selecting?

    Mohamed El Gohary

    M 1 Reply Last reply
    0
    • M Mohamed El Gohary

      I try to remove an item from a DataSet using DataRow.Delete(), then I try to do a linq query operation to select from the same table. I always get an exception because the deleted rows cannot be accessed. "Deleted row information cannot be accessed through the row." Is there a way to overcome this error while selecting?

      Mohamed El Gohary

      M Offline
      M Offline
      Michael Eber
      wrote on last edited by
      #2

      Did you commit your delete prior to your select? Don't have VS on this machine but I think it's something like context.SubmitUpdates();

      J 1 Reply Last reply
      0
      • M Michael Eber

        Did you commit your delete prior to your select? Don't have VS on this machine but I think it's something like context.SubmitUpdates();

        J Offline
        J Offline
        jpangamarca
        wrote on last edited by
        #3

        I run into the same issue today, I solved it by calling dataset.AcceptChanges(); :)

        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