Becky Bloomwood

Becky Bloomwood

  • NA
  • 119
  • 286k

Unable to delete records in grid view

Feb 10 2011 7:14 AM

Hi, I encountered a problem with deleting records from database. This is the error:

Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index


May I know what causes it?
This is the business logic:
 

protected void gvUploadedDocuments_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
vrmdb.Delete_UploadedNewDocuments(gvUploadedDocuments.DataKeys[e.RowIndex].Values[0].ToString());
BindGrid1();
}
Thanks!

Answers (5)