PageRenderTime 42ms CodeModel.GetById 20ms app.highlight 7ms RepoModel.GetById 13ms app.codeStats 0ms

/e_desk/registeruser.aspx.vb

http://github.com/shafiqissani/eDesk-Systems
Visual Basic | 70 lines | 50 code | 13 blank | 7 comment | 0 complexity | a9c439f946f09708439ca7bec1124ddf MD5 | raw file
 1Imports System.Data
 2Imports System.Data.SqlClient
 3
 4
 5Namespace e_desk
 6
 7Partial Class registeruser
 8    Inherits System.Web.UI.Page
 9
10#Region " Web Form Designer Generated Code "
11
12    'This call is required by the Web Form Designer.
13    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
14
15    End Sub
16
17
18    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
19        'CODEGEN: This method call is required by the Web Form Designer
20        'Do not modify it using the code editor.
21        InitializeComponent()
22    End Sub
23
24#End Region
25
26    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
27        'Put user code to initialize the page here
28    End Sub
29
30    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
31        Dim s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, str As String
32        s1 = t1.Text
33        s2 = t2.Text
34        s3 = t3.Text
35        s4 = t4.Text
36        s5 = t5.Text
37        s6 = t6.Text
38        s7 = t7.Text
39        s8 = t8.Text
40        s9 = t9.Text
41        s10 = t10.Text
42        s11 = t11.Text
43        s12 = t12.SelectedItem.Value
44        s13 = t13.Text
45
46        Dim con As New SqlConnection("server=(local);uid=sa;database=eDesk")
47        'con.Open()
48        Dim dr As SqlDataReader
49        Dim cmd1 As SqlCommand
50        str = "select * from registration where userid='" & s10 & "'"
51        cmd1 = New SqlCommand(str, con)
52        con.Open()
53        dr = cmd1.ExecuteReader()
54        If dr.Read Then
55            Response.Write("user id is already exist.. Please give another user id")
56        Else
57            con.Close()
58            'con.Open()
59            str = "insert into registration values('" & s1 & "','" & s2 & "','" & s3 & "','" & s4 & "','" & s5 & "','" & s6 & "','" & s7 & "'," & s8 & ",'" & s9 & "','" & s10 & "','" & s11 & "','" & s12 & "','" & s13 & "','user')"
60            'str = "insert into registration (name,address,phoneno) values('" & s1 & "','" & s2 & "','" & s3 & "')"
61            Dim cmd As SqlCommand = New SqlCommand(str, con)
62            con.Open()
63            cmd.ExecuteNonQuery()
64            con.Close()
65            Response.Redirect("index.aspx")
66        End If
67    End Sub
68End Class
69
70End Namespace