01.
Private
Sub
drugdetailDGV_CellValueChanged(
ByVal
sender
As
System.
Object
,
ByVal
e
As
System.Windows.Forms.DataGridViewCellEventArgs)
Handles
drugdetailDGV.CellValueChanged
02.
UseConnectDatabase()
03.
Dim
com
As
New
MySqlCommand
04.
Dim
adap
As
New
MySqlDataAdapter
05.
Dim
ds
As
New
DataSet
06.
If
(TabControl1.SelectedIndex = 0)
Then
07.
08.
com.CommandText =
"update drug_detail set de_name='"
& drugdetailDGV.CurrentRow.Cells(1).Value &
"',de_result='"
& drugdetailDGV.CurrentRow.Cells(2).Value &
"' where de_id='"
& drugdetailDGV.CurrentRow.Cells(0).Value &
"'"
09.
com.Connection = MyConnect
10.
11.
com.ExecuteNonQuery()
12.
13.
End
If
14.
End
Sub