0

can you help me how to select from multiple tables. so far this is my code how do i

Dim dr As OleDbDataReader

    Dim dc As New OleDbCommand

        dc.Connection = conn
        dc.CommandText = "SELECT * FROM tblClient, tblLoan WHERE ClientNo =  '" & ClientNo & "'"
        dr = dc.ExecuteReader
        If dr.HasRows Then
            While dr.Read

                    'for tblCLient
                    frmClientsProfile.lblClientNo.Text = dr.Item(0)
                    frmClientsProfile.lblFirstName.Text = dr.Item(1)
                    frmClientsProfile.lblLastName.Text = dr.Item(2)
                    frmClientsProfile.lblAge.Text = dr.Item(3)
                    frmClientsProfile.lblAddress.Text = dr.Item(4)
                    frmClientsProfile.lblBirthday.Text = dr.Item(5)
                    frmClientsProfile.lblGender.Text = dr.Item(6)
                    frmClientsProfile.lblContactNo.Text = dr.Item(7)
                    ' for tblLoan
                    'frmClientsProfile.lblBalance.text = dr.item() <- what should i put here?

                End While
            End If

Edited by shizzle08

2
Contributors
2
Replies
3
Views
4 Years
Discussion Span
Last Post by poojavb
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.