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