Question Please Help: One-To-Many Data Entry Form

DaNuGai

New member
Joined
Jul 2, 2010
Messages
1
Programming Experience
Beginner
Using this tutorial How Do I: Create a One-to-Many Data Entry Form? as a reference

Suppose I have a parameter query called FillByStatus in my "Customer" DataTable and I want to fill the CustomerTableAdapter On Form_Load using this query. So I can do that by using the following code:

VB.NET:
Expand Collapse Copy
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles MyBase.Load
   Me.OrdersTableAdapter.Fill(Me.CustomerOrdersDataSet.Orders)
   Me.CustomerTableAdapter.FillByStatus(Me.CustomerOrdersDataSet.Customer, "Active")
End Sub

However, when I do that my related DataGridView (orders) is empty, how do I make it so that doesn't happen?

Thanks in advance.
 
However, when I do that my related DataGridView (orders) is empty, how do I make it so that doesn't happen?
Are you certain that the Orders table contains related data, and is the one referenced by the controls on the form? i.e. have you paused your app in the debugger and opened the dataset visualizer (point to the dataset, then click the magnifying glass icon in the tooltip) to check 100% certain that data is in there, and is related

Are you sure that you made your datarelation in the dataset in the right way, and the right way round?

Did you bind the Orders data grid to a bindingsource, and that bindingsource is bound to the relation object exposed by the Customer bindingsource..

Are the two related columns the same data type?
 
Back
Top