01.
Private
Sub
DataGridView1_CellMouseDoubleClick(sender
As
Object
, e
As
DataGridViewCellMouseEventArgs)
Handles
DataGridView1.CellMouseDoubleClick
02.
03.
Dim
i
As
Integer
04.
i = DataGridView1.CurrentRow.Index
05.
Dim
B_ID
As
Integer
06.
07.
B_ID = Convert.ToUInt32(DataGridView1.Item(1, i).Value)
08.
StrSQL =
"INSERT INTO renttmp1(Barcode_ID,DateOver)VALUES("
& B_ID &
", NOW())"
09.
ds =
New
DataSet
10.
da =
New
MySqlDataAdapter(StrSQL, MySQLConn)
11.
da.Fill(ds,
"renttmp1"
)
12.
13.
Call
UpdateOverDays()
14.
15.
MySQLConn.Close()
16.
17.
Me
.Close()
18.
End
Sub
19.
20.
Sub
UpdateOverDays()
21.
StrSQL =
"UPDATE renttmp1 SET OverDays = DATEDIFF(now(),DateOver) WHERE ID"
22.
ds =
New
DataSet
23.
da =
New
MySqlDataAdapter(StrSQL, MySQLConn)
24.
da.Fill(ds,
"renttmp1"
)
25.
26.
End
Sub