I have two datagridview tables and I want to build a master/detail relationship of these two tables. I can make a query to show data on master table but don't know how to link detail table to master table. Especially I don't know how to build a datarelation between master and detail. Detail table has 5 columns to form a primary key. The following is my code:
Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
If e.KeyCode = System.Windows.Forms.Keys.F11 Then
Try
Me.BGHuntedTableAdapter.Fill(Me.SurveysDataSet.BGHunted) \this is my master table
Me.BGHarvestTableAdapter.Fill(Me.SurveysDataSet.BGHarvest) \this is my detail table
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try
End If
End Sub
Somebody please give me some good direction. Thanks.
Ben