PageRenderTime 270ms CodeModel.GetById 260ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/e_desk/updateinfo_user.aspx.vb

http://github.com/shafiqissani/eDesk-Systems
Visual Basic | 75 lines | 56 code | 12 blank | 7 comment | 0 complexity | 5c8fafea71440f20d2f5ec2690228865 MD5 | raw file
 1Imports System.Data
 2Imports System.Data.SqlClient
 3
 4
 5Namespace e_desk
 6
 7Partial Class updateinfo_user
 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        Dim con As SqlConnection = New SqlConnection("Server=(local);uid=sa;database=eDesk")
29        con.Open()
30        Dim str As String
31        str = "select * from registration where userid='" + Session("username") + "' "
32        Dim cmd1 As SqlCommand = New SqlCommand(str, con)
33        Dim dr As SqlDataReader
34        dr = cmd1.ExecuteReader()
35        dr.Read()
36        t1.Text = dr.GetValue(0)
37        t2.Text = dr.GetValue(1)
38        t3.Text = dr.GetValue(2)
39        t4.Text = dr.GetValue(3)
40        t5.Text = dr.GetValue(4)
41        t6.Text = dr.GetValue(5)
42        t7.Text = dr.GetValue(6)
43        t8.Text = dr.GetValue(7)
44        t9.Text = dr.GetValue(8)
45        t10.Text = dr.GetValue(10)
46    End Sub
47
48    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
49        Dim con As SqlConnection = New SqlConnection("Server=(local);uid=sa;database=eDesk")
50        con.Open()
51        Dim s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, str, uname As String
52        s1 = t1.Text
53        s2 = t2.Text
54        s3 = t3.Text
55        s4 = t4.Text
56        s5 = t5.Text
57        s6 = t6.Text
58        s7 = t7.Text
59        s8 = t8.Text
60        s9 = t9.Text
61        s10 = t10.Text
62        uname = Session("username")
63        str = "update registration set name = '" + s1 + "' , address = '" + s2 + "', phoneno = '" + s3 + "', city = '" + s4 + "', state = '" + s5 + "', country = '" + s6 + "', gender = '" + s7 + "', zipcode = " + s8 + ", emailid = '" + s9 + "', password='" + s10 + "' where userid ='" + uname + "'"
64        'Response.Write(str)
65        Dim cmd As SqlCommand = New SqlCommand
66        cmd.Connection = con
67        cmd.CommandText = str
68        'cmd.ExecuteNonQuery()
69        Response.Write("record updated")
70        Panel2.Visible = False
71        'Response.Redirect("user_menu.aspx")
72    End Sub
73End Class
74
75End Namespace