-
Notifications
You must be signed in to change notification settings - Fork 0
/
Signup.aspx.vb
36 lines (34 loc) · 1.47 KB
/
Signup.aspx.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports Microsoft.VisualBasic
Imports System.Windows
Imports System.Collections
Partial Class Signupp
Inherits System.Web.UI.Page
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
End Sub
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim con As New SqlConnection
Dim cmd As New SqlCommand
con.ConnectionString = "Data Source=HEWLETT-PACKARD\SQLEXPRESS;Initial Catalog=BookMyShow;Integrated Security=True"
con.Open()
cmd.Connection = con
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "signup"
cmd.Parameters.Add("@uname", SqlDbType.VarChar, 20).Value = txtusername.Text
cmd.Parameters.Add("@pass", SqlDbType.VarChar, 20).Value = txtpassword.Text
cmd.Parameters.Add("@cont", SqlDbType.VarChar, 20).Value = txtmob.Text
cmd.Parameters.Add("@email", SqlDbType.VarChar, 20).Value = txtmail.Text
cmd.Parameters.Add("@result", SqlDbType.Int).Direction = ParameterDirection.Output
cmd.ExecuteNonQuery()
Dim res As Integer
res = cmd.Parameters("@result").Value
If (res = 1) Then
Label5.Text = "OOPS!User Already exists"
Else
Label5.Text = "Signed Up Successfully"
Response.Redirect("LoginPage.aspx")
End If
End Sub
End Class