Results 1 to 10 of 10

Thread: Registration Form error...{RESOLVED}

Threaded View

  1. #1

    Thread Starter
    ^:^...ANGEL...^:^ wrack's Avatar
    Join Date
    Mar 2002
    Location
    Melbourne, AUSTRALIA
    Posts
    2,695

    Thumbs up Registration Form error...{RESOLVED}

    Can someone please try this url to register and see what error they are getting...???

    http://wrack.mine.nu/UniProject/Forms/Registration.aspx

    When I run the project by pressing F5 it works like a charm but when someone else try to run that page from Internet they get an error...

    VB Code:
    1. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    2.         If Not IsPostBack Then
    3.             txtUserName.Text = ""
    4.             txtPassword.Text = ""
    5.             txtFirstName.Text = ""
    6.             txtLastName.Text = ""
    7.             txtAddress.Text = ""
    8.             txtSuburb.Text = ""
    9.             txtCity.Text = ""
    10.             txtState.Text = ""
    11.             txtPostCode.Text = ""
    12.             txtCountry.Text = "Australia"
    13.             txtEMail.Text = ""
    14.             txtContact.Text = ""
    15.         End If
    16.     End Sub
    17.  
    18.     Private Sub cmdReset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdReset.Click
    19.         txtUserName.Text = ""
    20.         txtPassword.Text = ""
    21.         txtFirstName.Text = ""
    22.         txtLastName.Text = ""
    23.         txtAddress.Text = ""
    24.         txtSuburb.Text = ""
    25.         txtCity.Text = ""
    26.         txtState.Text = ""
    27.         txtPostCode.Text = ""
    28.         txtCountry.Text = "Australia"
    29.         txtEMail.Text = ""
    30.         txtContact.Text = ""
    31.     End Sub
    32.  
    33.     Private Sub cmdSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSubmit.Click
    34.         Dim cnnRegistration As SqlConnection
    35.         Dim cmdRegistration As SqlCommand
    36.         Dim dtrRegistration As SqlDataReader
    37.         Dim strSQL As String
    38.  
    39.         cnnRegistration = New SqlConnection("server=WRACK\SQLDB;uid=sa;pwd=;database=NW;")
    40.  
    41.         strSQL = "SELECT [UserName] FROM tblUsers Where UserName = '" & txtUserName.Text & "' ORDER BY [UserName]"
    42.         cmdRegistration = New SqlCommand(strSQL, cnnRegistration)
    43.         cnnRegistration.Open()
    44.         dtrRegistration = cmdRegistration.ExecuteReader
    45.  
    46.         If dtrRegistration.Read() Then
    47.             If Trim(txtUserName.Text) = Trim(dtrRegistration("UserName")) Then
    48.                 lblError.Text = "User Name is not available. Please choose another User Name."
    49.             End If
    50.         Else
    51.             dtrRegistration.Close()
    52.             cnnRegistration.Close()
    53.  
    54.             strSQL = "INSERT INTO tblUsers " & _
    55.                     "(" & _
    56.                     "[UserName], [Password], [FirstName], [LastName] ," & _
    57.                     "[Address], [Suburb], [City], [State], [PostCode] ," & _
    58.                     "[Country], [EMail], [Contact]" & _
    59.                     ") VALUES (" & _
    60.                     "'" & txtUserName.Text & "', '" & txtPassword.Text & "', " & _
    61.                     "'" & txtFirstName.Text & "', '" & txtLastName.Text & "', " & _
    62.                     "'" & txtAddress.Text & "', '" & txtSuburb.Text & "', " & _
    63.                     "'" & txtCity.Text & "', '" & txtState.Text & "', " & _
    64.                     "'" & txtPostCode.Text & "', '" & txtCountry.Text & "', " & _
    65.                     "'" & txtEMail.Text & "', '" & txtContact.Text & "')"
    66.  
    67.             cmdRegistration = New SqlCommand(strSQL, cnnRegistration)
    68.  
    69.             cnnRegistration.Open()
    70.  
    71.             If ValidateEntry(txtUserName.Text, txtPassword.Text, txtFirstName.Text, _
    72.                                 txtLastName.Text, txtAddress.Text, txtSuburb.Text, _
    73.                                 txtCity.Text, txtState.Text, txtPostCode.Text, _
    74.                                 txtCountry.Text, txtEMail.Text) = True Then
    75.  
    76.                 dtrRegistration = cmdRegistration.ExecuteReader
    77.                 lblError.Text = "Registration successful...Please go to Login page to gain access."
    78.             End If
    79.         End If
    80.  
    81.         dtrRegistration.Close()
    82.         cnnRegistration.Close()
    83.     End Sub
    84.  
    85.     Private Function ValidateEntry(ByVal s1 As String, _
    86.                                    ByVal s2 As String, _
    87.                                    ByVal s3 As String, _
    88.                                    ByVal s4 As String, _
    89.                                    ByVal s5 As String, _
    90.                                    ByVal s6 As String, _
    91.                                    ByVal s7 As String, _
    92.                                    ByVal s8 As String, _
    93.                                    ByVal s9 As String, _
    94.                                    ByVal s10 As String, _
    95.                                    ByVal s11 As String) As Boolean
    96.         If s1 = "" Then
    97.             lblError.Text = "*UserName is REQUIRED."
    98.             ValidateEntry = False
    99.         Else
    100.             If s2 = "" Then
    101.                 lblError.Text = "*Password is REQUIRED."
    102.                 ValidateEntry = False
    103.             Else
    104.                 If s3 = "" Then
    105.                     lblError.Text = "*FirstName is REQUIRED."
    106.                     ValidateEntry = False
    107.                 Else
    108.                     If s4 = "" Then
    109.                         lblError.Text = "*LastName is REQUIRED."
    110.                         ValidateEntry = False
    111.                     Else
    112.                         If s5 = "" Then
    113.                             lblError.Text = "*Address is REQUIRED."
    114.                             ValidateEntry = False
    115.                         Else
    116.                             If s6 = "" Then
    117.                                 lblError.Text = "*Suburb is REQUIRED."
    118.                                 ValidateEntry = False
    119.                             Else
    120.                                 If s7 = "" Then
    121.                                     lblError.Text = "*City is REQUIRED."
    122.                                     ValidateEntry = False
    123.                                 Else
    124.                                     If s8 = "" Then
    125.                                         lblError.Text = "*State is REQUIRED."
    126.                                         ValidateEntry = False
    127.                                     Else
    128.                                         If s9 = "" Then
    129.                                             lblError.Text = "*PostCode is REQUIRED."
    130.                                             ValidateEntry = False
    131.                                         Else
    132.                                             If s10 = "" Then
    133.                                                 lblError.Text = "*Country is REQUIRED."
    134.                                                 ValidateEntry = False
    135.                                             Else
    136.                                                 If s11 = "" Then
    137.                                                     lblError.Text = "*EMail is REQUIRED."
    138.                                                     ValidateEntry = False
    139.                                                 Else
    140.                                                     If Len(s5) > 100 Then
    141.                                                         lblError.Text = "*Address can not be more than 100 characters."
    142.                                                         ValidateEntry = False
    143.                                                     Else
    144.                                                         ValidateEntry = True
    145.                                                     End If
    146.                                                 End If
    147.                                             End If
    148.                                         End If
    149.                                     End If
    150.                                 End If
    151.                             End If
    152.                         End If
    153.                     End If
    154.                 End If
    155.             End If
    156.         End If
    157.     End Function

    I am getting this error...
    Attached Images Attached Images  
    Last edited by wrack; Jun 1st, 2003 at 10:50 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width