01.
Private
Sub
Select_Table()
02.
Dim
sql
As
String
=
"SELECT * FROM employee ORDER BY employee_id"
03.
Da =
New
OleDbDataAdapter(sql, Conn)
04.
Da.Fill(Ds, Table_Name)
05.
Ds.Tables.Clear()
06.
Da.Fill(Ds, Table_Name)
07.
Dt = Ds.Tables(Table_Name)
08.
09.
Dim
Cmd
As
New
OleDbCommand
10.
Cmd.Connection = Conn
11.
Cmd.CommandText =
"SELECT * FROM tb_position"
12.
Dim
Drs
As
OleDbDataReader = Cmd.ExecuteReader
13.
Dim
num
As
Integer
= 0
14.
Dim
str1
As
String
=
""
15.
16.
For
Each
dr
As
DataRow
In
Ds.Tables(0).Rows
17.
While
Drs.Read
18.
If
dr.Item(
"position_id"
) = Drs.Item(0)
Then
19.
str1 = Drs.Item(1)
20.
Exit
While
21.
End
If
22.
End
While
23.
Ds.Tables(0).Rows.Item(num).Item(
"position_id"
) = str1
24.
num = num + 1
25.
Next
26.
27.
End
Sub