Rowupdating index was out of range
If it helps, paste up the full exception message generated - the one that shows the stack trace.
- When the record is deleted the gridview is re-binded with the data from database(after deleting the current record).(I think the problem is somewhere here). My databinding code is: [quote](I think the problem is somewhere here).[/quote]Royal, have you stepped through your code to see where the exception is thrown? you should be able to trace to exactly where it occurs.
Must be non-negative and less than the size of the collection.
On Row Deleting(Grid View Delete Event Args e) 99 System.
It *looks* like you're trying to delete a record with an *ID* that matches the *index* of the record in the Grid Vew which is unlikely to work, but it's hard to say without relevant information.
Connection = myconnection Msg Box("Do you want to Update", Msg Box Style. I am not psychic, don't know how your Grid View looks like, where it gets its data from, what happens when you debug the code, whether or not the code even compiles, what you see when you step through it with the debugger, what you know or don't know about Grid View. Without all that, I don't understand how you think we can help you.
It doesn't happen when I add a new row but it does occur when I try to delete or update a row. The designer is: You are not setting the name of the data key for the Grid, but your delete method references Data Keys[e. This error exception is thrown mostly when you try accessing an item at an index that isn't present.The best way to resolve the issue is to debug and check the length of the array or the data table indexes and then see whether you are deleting the correct index or not. Grid View Update Event Args) Handles Data Grid Odin.
Open() mycommand = New Sql Command("sp_Service Updt", myconnection) mycommand.
Rows(i - 1)("Rec ID") = lbl Voucher row Index = 1 Next dt Current Data. Add(dr Current Row) View State("Current Data") = dt Current Data Grid View1. Write("View State is null") End If Set Previous Data() End Sub Private Sub Set Previous Data() Dim row Index As Integer = 0 If View State("Current Data") Is Not Nothing Then Dim dt As Data Table = Direct Cast(View State("Current Data"), Data Table) If dt.