Is it possible to navigate multiple tables at a time....
The two tables are joined with primary and foreign key relationship...


Pls give me some site to which i can refer or some sample code for all first,next,previous,last


I can do it when its single table....

Private Sub btnFirst_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFirst.Click
        ' con.Open()

        If inc <> 0 Then
            inc = 0
            ' con.Close()
            NavigateRecords()
        End If

    End Sub

    Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
        ' con.Open()
        If inc <> MaxRows - 1 Then
            inc = inc + 1
            '  con.Close()
            NavigateRecords()
        Else
            MsgBox("No More Rows")
        End If


    End Sub

    Private Sub btnLast_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLast.Click
        'con.Open()
        If inc <> MaxRows - 1 Then
            inc = MaxRows - 1
            'con.Close()
            NavigateRecords()
        End If


    End Sub

Private Sub btnPrevious_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrevious.Click
        ' con.Open()
        If inc > 0 Then
            inc = inc - 1
            ' con.Close()
            NavigateRecords()
        Else
            MsgBox("First Record")
        End If


    End Sub

Private Sub NavigateRecords()
        '  con.Open()
        txtId.Text = ds.Tables("Cust").Rows(inc).Item(0)
        txtFn.Text = ds.Tables("Cust").Rows(inc).Item(1)
        txtLn.Text = ds.Tables("Cust").Rows(inc).Item(2)
        txtAddress.Text = ds.Tables("Cust").Rows(inc).Item(3)
        txtMob.Text = ds.Tables("Cust").Rows(inc).Item(4)
        txtLand.Text = ds.Tables("Cust").Rows(inc).Item(5)
        Dim chkLC As String
        chkLC = ds.Tables("Cust").Rows(inc).Item(6)
        If chkLC = "0" Then
            chkLCo.CheckState = CheckState.Unchecked
        Else
            chkLCo.CheckState = CheckState.Checked
        End If
        'con.Close()
    End Sub

PLS HELP ME OUT......

Recommended Answers

All 4 Replies

you can write a join query on the database .. then store the data in a dataset.

then browser this dataset rather than the Database itself.. its called disconnected database..

If possible give me some sample it will b good...
THANKS

Thanks.....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.