glossData.EditItemIndex = -1
DeleteData(PrimaryKey)
'viewstate("sortField") = "gTerm" 'viewstate("sortField") = "key_word"viewstate("sortField") = "Username"
viewstate("sortDirection") = "ASC"
End Sub
Have the following code here but theres an error stating:
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.FormatException: Input string was not in a correct format.
Source Error:
Line 249: Public Sub DeleteRecord(ByVal sender As System.Object, ByVal e As DataGridCommandEventArgs)
Line 250:
Line 251: Dim PrimaryKey As Int32 = Convert.ToInt32(glossData.DataKeys(e.Item.ItemIndex))
Line 252: glossData.EditItemIndex = -1
Line 253: DeleteData(PrimaryKey)
Can someone tel me wads the error bout and how to solve it

System.FormatException: Input string was not in a correct format.
ofer ebert
THat function actually deletes a record .
Stefan Wenig
without knowing what "glossData.DataKeys(e.Item.ItemIndex))" does..all I can tell you about your error is that
"glossData.DataKeys(e.Item.ItemIndex))" produces a string that can not be converted to an integer
Shankar K
Break out that one line of code into 3 lines:
one line taking the ItemIndex - and validating it.
One line taking the DataKeys - and validating it.
One line performing the Integer conversion - and validating it.
Report any invalidation back, or fix the error through limiting data entry values, or coercion of values (depending on what you are doing).