Asp.Net News
Free Tech Magazines
Asp.Net Web Hosting
Suggest Us
Link to Us
Feeds Subscription
Questions & Answers
Tips & Tricks
 to delete a row from database througgh gridview controls
Posted by sumit agarwal on  8/13/2007 6:50:41 AM Category: Asp.Net 2.0
Add to my favorites
Email to friend
i have problem to get id of item

Dim id As Integer = Convert.ToInt32(GridView1.DataKeys(e.RowIndex).Value)

m writing above code line to get id of item in rowdeleting command of gridview but i run it in browser & click on delete link there is a exception occured as

Server Error in '/WebSite4' Application.
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

plz. help me........

Post Your Reply Post New Question

 Viewer's Reply
Add index to the Values
Answered By Moderator1 on 8/18/2007 11:46:24 PM
Please try like this.

Post Your Reply If you still have problem, post it again under this reply for better response.

Sponsored by
The ASP.NET 2.0 Anthology: 101 Essential Tips, Tricks & Hacks - Free 156 Page Preview
The JavaScript Anthology: 101 Essential Tips, Tricks & Hacks - Free 158 Page Preview
No Nonsense XML Web Development With PHP - Free 146 Page Preview!