ITSourceCode.com

We Exist to Provide 100% Free Source Code and Tutorials

Custom Search

10-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.

  1. Private Sub ManageUserForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  2. 'MAKING THE TEXT INTO DOTS IN THE PASSWORD TEXTBOX
  3. txtPassword.UseSystemPasswordChar = True
  4. 'ADD ITEM IN THE COMBOBOX
  5. With cboType.Items
  6. .Add("Administrator")
  7. .Add("Staff")
  8. .Add("Encoder")
  9. End With
  10. End Sub

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.

  1. Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
  2. query = "insert into `useraccounts` (`USER_ID`, `UNAME`, `USERNAME`, `PASS`, `TYPE`)" & _
  3. "values ('" & txtUserId.Text & "','" & txtName.Text & "','" & txtUsername.Text & _
  4. "','" & txtPassword.Text & "','" & cboType.Text & "')"
  5. mysqlCreate(query)
  6. End Sub
Facebook Comments

Check Your Domain Ranking

Leave a Reply

Your email address will not be published. Required fields are marked *

ITSourceCode.com © 2016 Frontier Theme