I am studying vb.net and am trying to develop a data access program
I am getting the following error when I try to add a new record to the dataset. Any help would be great
error " Input string was not in correct format. Could not store<LinenIndex> in LinenItemsID colomn expected type is int32"
On the sql database both tables column are set to int but I don't know how to pass the value member as as int32 at runtime
Thanks
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim ds As New DataSet
Dim Dalin As New SqlDataAdapter("Select * From TblLinen", Con)
Dalin.Fill(ds, "TblLinen")
Try
Dim NewRow As DataRow
NewRow = ds.Tables("TblLinen").NewRow
NewRow("CustomerID") = Me.cboCustomer.ValueMember
NewRow("LinenItemsID") = Me.cboItems.ValueMember
NewRow("Quantity") = Me.txtQuantity.Text
ds.Tables("TblLinen").Rows.Add(NewRow)
Catch ex As Exception
MessageBox.Show("Message" & ex.ToString & "Failed to add new row to DataTable ")
End Try
End Sub