Imports MySql
Imports MySql
Imports MySql
MySqlClient
fill()
End Sub
myGridView.DataSource = myDT
' Database --> Adapter (Select) --> DataTable
--> Control/Object (Gridview)
End Sub
End Sub
Private Sub txtSearch_TextChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
txtSearch.TextChanged
myGridView.DataSource = myDT
End Sub
If (myConn.State =
Data.ConnectionState.Closed) Then
myConn.Open()
End If
myCMD.Connection = myConn
myCMD.CommandText = strSQL
myCMD.ExecuteNonQuery()
MessageBox.Show("Record Saved!")
fill()
Else
MessageBox.Show("Record already exists!")
End If
End Sub
row = myGridView.CurrentRow.Index
End Sub
myCMD.Connection = myConn
myCMD.CommandText = strSQL
myCMD.ExecuteNonQuery()
MessageBox.Show("Record Updated!")
fill()
End Sub
If (myConn.State =
Data.ConnectionState.Closed) Then
myConn.Open()
End If
myCMD.Connection = myConn
myCMD.CommandText = strSQL
myCMD.ExecuteNonQuery()
MessageBox.Show("Record Deleted!")
fill()
End If
End Sub
End Class