01.
Dim
d_adap
As
SqlDataAdapter
02.
Dim
d_set
As
DataSet =
New
DataSet
03.
d_adap =
New
SqlDataAdapter(
"Select DATEADD(MONTH, -2, Exp_date)"
& _
04.
"from Vaccine"
, sqlConnection)
05.
d_adap.Fill(d_set,
"Vaccine"
)
06.
DataGridView2.DataSource = d_set.Tables(
"Vaccine"
)
07.
08.
Dim
i
As
Integer
09.
For
i = 0
To
d_set.Tables(
"Vaccine"
).Rows.Count - 1
10.
11.
If
d_set.Tables(
"Vaccine"
).Rows(i).ToString =
Date
.Now.ToString(
"MM/dd/yyyy"
)
Then
12.
MessageBox.Show(
"มีวัคซีนหมดอายุวันนี้"
,
"Warning !!"
, MessageBoxButtons.OK, MessageBoxIcon.Warning)
13.
End
If
14.
Next