VB .NET master\detail database update position Datagridview

I have a master\detail database with two tables, I have connected them in one dataset and made the relatioship,
I insert on the form one textbox with the databinding to the field of the master table and a datagridview to the datasource and datamember of the detail table.
I want to have a button to move to the next row of the master and to follow the datagrid to the details of the of the record of the textbox.
here is some code wich is not working.
Private Sub SetRowPos(ByVal intPos As Integer)
        Me.BindingContext(DataSet81, "EPONIMIA").Position = intPos
        DataGrid1.NavigateTo(intPos, "KATASTASI")
    End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim intpos As New Int32
            intpos = Me.BindingContext(DataSet81, "EPONIMIA").Position
            intpos += 1
        Catch errobj As Exception
            MsgBox(errobj.Message & vbCrLf & errobj.StackTrace)
        End Try

Open in new window

Who is Participating?
DeathraceConnect With a Mentor Commented:
correct me if i'm wrong, you are looking to populate Details view for a particular ..if so refer below links

above link helps you how to nagivate between the records in DB table...
DeathraceConnect With a Mentor Commented:
how to use binding context, for navigation.
kyriakos70Author Commented:
I need the procedure exactly on how to show the master table to textbox and the details to a datagrid.

kyriakos70Author Commented:
I have two tables master with two fields id=pk and EPONIMIA = char I set up 2 sqldataadapters one for the master and one for the detail table. I have generated a dataset and made the relationship inside the dataset by drag and drop the master pk to the detail fk. I have put on a form 2 texboxes one for each field of the master and a datagridview for the detailthe datagridview datasource to the detail table.
But when I run the application the datagrid view displays all the records I want to display only the records shown in the textboxes.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.