10-Register New User

This tutorial is all about Register New User.
In this tutorial, I’m going to teach you how to register a new user in the User’s Registration Form. with this, you can add the users with there different types.

 

 

So let’s begin:

 

 

Open the file of “EmployeesInformationSystem” that you had created and go to the “ManageUserForm“. After that, double click the Form and add the following code for adding the items in the ComboBox, and setting up the “Password” TextBox.

[vbnet]
Private Sub ManageUserForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
‘MAKING THE TEXT INTO DOTS IN THE PASSWORD TEXTBOX
txtPassword.UseSystemPasswordChar = True
‘ADD ITEM IN THE COMBOBOX
With cboType.Items
.Add(“Administrator”)
.Add(“Staff”)
.Add(“Encoder”)
End With
End Sub
[/vbnet]

Go back to the Form Design and double click the “Save” Button to fire the Click event handler of it. Set a insert query and call a method that you had created in saving the data in the MySQL Database.

[vbnet]
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
query = “insert into `useraccounts` (`USER_ID`, `UNAME`, `USERNAME`, `PASS`, `TYPE`)” & _
“values (‘” & txtUserId.Text & “‘,'” & txtName.Text & “‘,'” & txtUsername.Text & _
“‘,'” & txtPassword.Text & “‘,'” & cboType.Text & “‘)”
mysqlCreate(query)
End Sub
[/vbnet]

 

Readers might read also:

 

 

2 thoughts on “10-Register New User”

Leave a Comment