I'm using VB.NET 2003, and have created a simple Windows Form, connected to a single SQL db table, with a single data adapter and dataset.
When I try to debug I receive this error:
Here's the code:
AND, this is where it stops:
iCnt = Me.BindingContext(ItemDataSet, "VendorNo").Count
Help!
Thanks
Lorna
When I try to debug I receive this error:
An unhandled exception of type 'System.ArgumentException' occurred in system.windows.forms.dll
Additional information: Cannot create a child list for field VendorNo.
Here's the code:
VB.NET:
Private Sub btnVendor_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnVendor.Click
'Populates the DataSet
OleDbDataAdapter1.SelectCommand.Parameters("VendorNo").Value = txtVendor.Text
ItemDataSet.Clear()
OleDbDataAdapter1.Fill(ItemDataSet)
ShowPosition()
End Sub
Private Sub btnPrevious_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrevious.Click
Me.BindingContext(ItemDataSet, "VendorNo").Position -= 1
ShowPosition()
End Sub
Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
Me.BindingContext(ItemDataSet, "VendorNo").Position += 1
ShowPosition()
End Sub
Private Sub ShowPosition()
Dim iCnt As Integer
Dim iPos As Integer
iCnt = Me.BindingContext(ItemDataSet, "VendorNo").Count
If iCnt = 0 Then
txtPosition.Text = "(No Records)"
Else
iPos = Me.BindingContext(ItemDataSet, "VendorNo").Position + 1
txtPosition.Text = iPos.ToString & " of " & iCnt.ToString
End If
End Sub
iCnt = Me.BindingContext(ItemDataSet, "VendorNo").Count
Help!
Thanks
Lorna
Last edited by a moderator: