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