I receive this message while doing an .ExecuteNonQuery() method on a command:
System.InvalidCastException: Object must implement IConvertible.
It seems to happen when it starts looking at the Command's parameters. Here is where I build them:
System.InvalidCastException: Object must implement IConvertible.
It seems to happen when it starts looking at the Command's parameters. Here is where I build them:
Code:
' Adding the parameters.
Dim cmd As New OleDbCommand(strSQL.ToString, Me.conAccs)
Dim pc As OleDbParameterCollection = cmd.Parameters
myStr = Me.lblOrderNum.Text
pc.Add("OrderID", OleDbType.Integer).Value = CType(myStr, Int32)
pc.Add("SubjectID", OleDbType.Char).Value = Me.lbSubject.SelectedItem
For Each _item In Me.dgPrntSize.Items
If CType(_item.Cells(0).FindControl("tbQty"), TextBox).Text <> "" Then
Me.testInt = CType(CType(_item.Cells(0).FindControl("tbQty"), TextBox).Text, Int32)
i = _item.ItemIndex
pc.Add(Me.dsWed.Tables("Sizes").Rows(i).Item("packName"), OleDbType.Integer).Value = CType(_item.Cells(0).FindControl("tbQty"), TextBox).Text
End If
Next