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. deleting data from datagrid

deleting data from datagrid

Scheduled Pinned Locked Moved Database
databasehelpannouncement
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.
  • M Offline
    M Offline
    minkinin
    wrote on last edited by
    #1

    Hi Everyone. I am trying to delete data from datagrid here is my code: DataTable tbl = new DataTable("timesheet"); tbl = ds.Tables[0]; int i = this.iRowIndex tbl.Rows[i].Delete(); this.daDisplay.Update(tbl); I am getting an exception: "there is no row at position 0",whereas there is data in the database...what can be the proble,I can't seem to figure it out. pls help..

    P 1 Reply Last reply
    0
    • M minkinin

      Hi Everyone. I am trying to delete data from datagrid here is my code: DataTable tbl = new DataTable("timesheet"); tbl = ds.Tables[0]; int i = this.iRowIndex tbl.Rows[i].Delete(); this.daDisplay.Update(tbl); I am getting an exception: "there is no row at position 0",whereas there is data in the database...what can be the proble,I can't seem to figure it out. pls help..

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      Well, you create the table as a standalone datatable, and then you point it to ds.Tables[0]. If you haven't actually read anything from the database then this will be the problem.

      the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
      Deja View - the feeling that you've seen this post before.

      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