Private Sub Select_Table()
Dim sql As String = "SELECT * FROM employee ORDER BY employee_id"
Da = New OleDbDataAdapter(sql, Conn)
Da.Fill(Ds, Table_Name)
Ds.Tables.Clear()
Da.Fill(Ds, Table_Name)
Dt = Ds.Tables(Table_Name)
Dim Cmd As New OleDbCommand
Cmd.Connection = Conn
Cmd.CommandText = "SELECT * FROM tb_position"
Dim Drs As OleDbDataReader = Cmd.ExecuteReader
Dim num As Integer = 0
Dim str1 As String = ""
For Each dr As DataRow In Ds.Tables(0).Rows
While Drs.Read
If dr.Item("position_id") = Drs.Item(0) Then
str1 = Drs.Item(1)
Exit While
End If
End While
Ds.Tables(0).Rows.Item(num).Item("position_id") = str1
num = num + 1
Next
End Sub
SELECT t1.employee_gender,t1.employee_sex,t1.employee_firstname,employee_lastname,t2.position_name
FROM employee t1 left join tb_position t2 on t1.Position_ID=t2.Position_ID order by t1.employee_id