01.
Sub
BindingsShowE()
02.
Dim
sql
As
String
=
"Select * FROM Employee"
03.
Dim
cmd
As
New
OleDbCommand(sql, connect)
04.
Dim
Adapter
As
New
OleDbDataAdapter(cmd)
05.
dataset =
New
DataSet
06.
Adapter.Fill(dataset,
"Employee"
)
07.
Dim
emname
As
String
=
""
08.
For
i = 0
To
dataset.Tables(
"Employee"
).Rows.Count - 1
09.
emname = dataset.Tables(
"Employee"
).Rows(i)(
"FullName"
)
10.
ListBox1.Items.Add(emname)
11.
Next
12.
TbxEmployeeID2.DataBindings.Add(
"text"
, dataset,
"Employee.IDEmployee"
)
13.
TbxTitleName2.DataBindings.Add(
"text"
, dataset,
"Employee.TitleName"
)
14.
tbxFullName2.DataBindings.Add(
"text"
, dataset,
"Employee.FullName"
)
15.
TbxSex2.DataBindings.Add(
"text"
, dataset,
"Employee.Sex"
)
16.
TbxAddress2.DataBindings.Add(
"text"
, dataset,
"Employee.Address"
)
17.
TbxZipCode2.DataBindings.Add(
"text"
, dataset,
"Employee.ZipCode"
)
18.
MtbxPhoneNumber2.DataBindings.Add(
"text"
, dataset,
"Employee.PhoneNumber"
)
19.
MtbxIDCard2.DataBindings.Add(
"text"
, dataset,
"Employee.IDCard"
)
20.
TbxBirthday.DataBindings.Add(
"text"
, dataset,
"Employee.Birthday"
)
21.
TbxStartDate.DataBindings.Add(
"text"
, dataset,
"Employee.StartDate"
)
22.
TbxPosition2.DataBindings.Add(
"text"
, dataset,
"Employee.Appointment"
)
23.
TbxSalary2.DataBindings.Add(
"text"
, dataset,
"Employee.Salary"
)
24.
TbxEducation2.DataBindings.Add(
"text"
, dataset,
"Employee.Education"
)
25.
TbxFaculty2.DataBindings.Add(
"text"
, dataset,
"Employee.Faculty"
)
26.
TbxBranch2.DataBindings.Add(
"text"
, dataset,
"Employee.Branch"
)
27.
Me
.BindingContext(dataset,
"Employee"
).Position = 0
28.
updateStatus()
29.
End
Sub