R
rn5a
A sub-routine retrieves the value in a TextBox (which ought to be an
integer) which in turn resides in a DataGrid (actually the column is a
BoundColumn which changes to a TextBox when the DataGrid is in the
editable mode). This is the code:
-----------------------------------
Dim strQty As String
Dim iQty As Integer
strQty = CType(ea.Item.Cells(5).Controls(0), TextBox).Text
iQty = CInt(strQty)
-----------------------------------
The last line iQty = CInt(strQty) generates the following error:
Input string was not in a correct format.
What's wrong with the last line in the above code?
integer) which in turn resides in a DataGrid (actually the column is a
BoundColumn which changes to a TextBox when the DataGrid is in the
editable mode). This is the code:
-----------------------------------
Dim strQty As String
Dim iQty As Integer
strQty = CType(ea.Item.Cells(5).Controls(0), TextBox).Text
iQty = CInt(strQty)
-----------------------------------
The last line iQty = CInt(strQty) generates the following error:
Input string was not in a correct format.
What's wrong with the last line in the above code?