Private Sub AddStaff_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
SQLConnection.ConnectionString = ServerString
Try
If SQLConnection.State = ConnectionState.Closed Then
SQLConnection.Open()
MsgBox("เชื่อมต่อกับฐานข้อมูลเรียบร้อย")
End If
SQLConnection.Clone()
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
Public Sub SaveNames(ByRef SQLStatement As String)
Dim cmd As MySqlCommand = New MySqlCommand
With cmd
.CommandText = SQLStatement
.CommandType = CommandType.Text
.Connection = SQLConnection
.ExecuteNonQuery()
End With
SQLConnection.Clone()
txtLastname.Clear()
txtAddressUser.Clear()
txtIDNation.Clear()
SQLConnection.Dispose()
End Sub