Brian
asked on
GridView Delete Command
Hello,
I'm having a problem deleting a row from a GridView however the row does in fact get removed from the GridView and also from the DB. This is where odd, and i have not been able to figure it out nor has a few other EE members. Please see the error message below.
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeE xception: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Source Error:
Line 168: WFID.SqlDbType = SqlDbType.Int
Line 169: WFID.Direction = ParameterDirection.Input
Line 170: WFID.Value = WWWFTPGridView.DataKeys(e. RowIndex.T oString).I tem(0).ToS tring()
Line 171:
Line 172: 'Or you can even use this code below and not added the SQLParameter code for WFID.
I'm having a problem deleting a row from a GridView however the row does in fact get removed from the GridView and also from the DB. This is where odd, and i have not been able to figure it out nor has a few other EE members. Please see the error message below.
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeE
Parameter name: index
Source Error:
Line 168: WFID.SqlDbType = SqlDbType.Int
Line 169: WFID.Direction = ParameterDirection.Input
Line 170: WFID.Value = WWWFTPGridView.DataKeys(e.
Line 171:
Line 172: 'Or you can even use this code below and not added the SQLParameter code for WFID.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER