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. Web Development
  3. ASP.NET
  4. Adding rows to a dataSet

Adding rows to a dataSet

Scheduled Pinned Locked Moved ASP.NET
question
2 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.
  • C Offline
    C Offline
    chubbysilk
    wrote on last edited by
    #1

    Hello, I am attempting to add rows to a dataSet using the InsertAt method. After adding a row, when I iterate through the dataSet to display the data, the new row does not appear. Also, the Rows.count does not increase. The strange thing is, if I bind the dataSet to a dataGrid, the new row does appear at the bottom, so the row is definitely being added. Does anybody know what's going on? Thanks, RC

    A 1 Reply Last reply
    0
    • C chubbysilk

      Hello, I am attempting to add rows to a dataSet using the InsertAt method. After adding a row, when I iterate through the dataSet to display the data, the new row does not appear. Also, the Rows.count does not increase. The strange thing is, if I bind the dataSet to a dataGrid, the new row does appear at the bottom, so the row is definitely being added. Does anybody know what's going on? Thanks, RC

      A Offline
      A Offline
      Anonymous
      wrote on last edited by
      #2

      You have to create a new DataRow object first, then populate it with the values befor adding it to the dataSet: c# Datarow dr = MyDataSet.tables[0].NewRow(); dr[0] = 'value'; dr[1] = 'value'; MyDataSet.tables[0].Rows.Add(dr); (I think I have the code correct, no ide here). If you are a vb'er Im sure you'll work it out from this. Hope it helps Rob

      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