How to create a Registration /Sign Up form in VB.Net

Funda Of Web IT
Funda Of Web IT
81.5 هزار بار بازدید - 6 سال پیش - Here.. in this video we
Here.. in this video we are doing the registration or sign up form for  the person to register for his email id and password with some details.. we are storing data into database. Code given Below.

 Try
           Dim con As New SqlConnection
           Dim cmd As New SqlCommand
           Dim dr As SqlDataReader

           con.ConnectionString = "Data Source=(LocalDB)\v11.0;AttachDbFilename=c:\users\ved prakash n\documents\visual studio 2012\Projects\FundaProjectVB\FundaProjectVB\FundaProject.mdf;Integrated Security=True"
           con.Open()
           cmd.Connection = con
           cmd.CommandType = CommandType.Text
           cmd.CommandText = "select * from register where email='" & email.Text & "' "
           dr = cmd.ExecuteReader
           If dr.HasRows Then
               MsgBox("Email Id Already Registered", MsgBoxStyle.Critical)
               con.Close()
           Else
               con.Close()
               con.Open()
               cmd = New SqlCommand("INSERT INTO register values('" & fname.Text & "','" & lname.Text & "','" & gender.Text & "','" & phone.Text & "','" & email.Text & "','" & password.Text & "')", con)
               If (fname.Text = "" And lname.Text = "" And gender.Text = "" And phone.Text = "" And email.Text = "" And password.Text = "") Then
                   MessageBox.Show("Please enter the details")
               Else
                   cmd.ExecuteNonQuery()
                   MsgBox("Succerssfully Registered.", MsgBoxStyle.Information, "Success")
                   Me.Hide()
                   login.show()
                   fname.Clear()
                   lname.Clear()
                   gender.Text = " "
                   phone.Clear()
                   email.Clear()
                   password.Clear()
               End If
               con.Close()
           End If
           con.Close()
       Catch ex As Exception
           MsgBox("Error")
       End Try
.
6 سال پیش در تاریخ 1397/09/19 منتشر شده است.
81,552 بـار بازدید شده
... بیشتر