-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRegistration.aspx.vb
56 lines (34 loc) · 1.42 KB
/
Registration.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Imports System.Data
Imports System.Data.Sql
Imports System.Data.SqlClient
Imports System.Configuration
Partial Class _Default
Inherits System.Web.UI.Page
Dim con As New SqlConnection("Data Source=SHUBHAM\SRKING;Initial Catalog=carrentals;Integrated Security=True")
Protected Sub Btnsubmit_Click(sender As Object, e As EventArgs) Handles Btnsubmit.Click
Dim a As String
Dim data As Boolean
data = True
If RadioButtonList1.Items(0).Selected = True Then
a = "male"
Else
a = "female"
End If
Dim str As String
str = "Insert into regis values(@fn,@ln,@address,@postcode,@contact,@gender,@email,@pass_word,@status)"
Dim cmd As New SqlCommand(str, con)
cmd.Parameters.AddWithValue("@fn", txtfirst.Text)
cmd.Parameters.AddWithValue("@ln", txtlast.Text)
cmd.Parameters.AddWithValue("@address", txtaddress.Text)
cmd.Parameters.AddWithValue("@postcode", txtpostcode.Text)
cmd.Parameters.AddWithValue("@contact", txtcontact.Text)
cmd.Parameters.AddWithValue("@gender", a)
cmd.Parameters.AddWithValue("@email", txtemail.Text)
cmd.Parameters.AddWithValue("@pass_word", txtpass.Text)
cmd.Parameters.AddWithValue("@status", data)
con.Open()
cmd.ExecuteNonQuery()
con.Close()
Response.Redirect("login.aspx")
End Sub
End Class