5
Reply

Unable to delete records in grid view

Becky Bloomwood

Becky Bloomwood

Feb 10 2011 7:14 AM
12k

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)