Imports MySql.Data
Imports MySql.Data.MySqlClient
Public Class Adduser
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
Dim fdCon As New MySqlConnection("Database=com;Data Source=localhost;User Id=root;Password=654321")
Dim fdCom As New MySqlCommand("", fdCon)
fdCon.Open()
Dim Id As String = EmployeeIdText.Text
Dim UserTitle As String = UserTitleText.Text
Dim UserName As String = UserNameText.Text
Dim UserLastname As String = UserLastnameText.Text
Dim UserPassword As String = UserPasswordText.Text
fdCom.CommandText = "INSERT INTO login_user (login_user_employee_id,login_user_title,login_user_name,login_user_lastname,login_user_password,position_id,department_id) VALUES ('" & Id & "','" & UserTitle & "','" & UserName & "','" & UserLastname & "','" & UserPassword & "')"
fdCom.ExecuteNonQuery()
fdCon.Close()
MsgBox("เพิ่มข้อมูล เรียบร้อยแล้ว ครับ")
btnSave.Enabled = False
btnCancle.Enabled = False
EmployeeIdText.Enabled = False
UserTitleText.Enabled = False
UserNameText.Enabled = False
UserLastnameText.Enabled = False
UserPasswordText.Enabled = False
End Sub
End Class