wrack
Jun 1st, 2003, 03:39 AM
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...
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
txtUserName.Text = ""
txtPassword.Text = ""
txtFirstName.Text = ""
txtLastName.Text = ""
txtAddress.Text = ""
txtSuburb.Text = ""
txtCity.Text = ""
txtState.Text = ""
txtPostCode.Text = ""
txtCountry.Text = "Australia"
txtEMail.Text = ""
txtContact.Text = ""
End If
End Sub
Private Sub cmdReset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdReset.Click
txtUserName.Text = ""
txtPassword.Text = ""
txtFirstName.Text = ""
txtLastName.Text = ""
txtAddress.Text = ""
txtSuburb.Text = ""
txtCity.Text = ""
txtState.Text = ""
txtPostCode.Text = ""
txtCountry.Text = "Australia"
txtEMail.Text = ""
txtContact.Text = ""
End Sub
Private Sub cmdSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSubmit.Click
Dim cnnRegistration As SqlConnection
Dim cmdRegistration As SqlCommand
Dim dtrRegistration As SqlDataReader
Dim strSQL As String
cnnRegistration = New SqlConnection("server=WRACK\SQLDB;uid=sa;pwd=;database=NW;")
strSQL = "SELECT [UserName] FROM tblUsers Where UserName = '" & txtUserName.Text & "' ORDER BY [UserName]"
cmdRegistration = New SqlCommand(strSQL, cnnRegistration)
cnnRegistration.Open()
dtrRegistration = cmdRegistration.ExecuteReader
If dtrRegistration.Read() Then
If Trim(txtUserName.Text) = Trim(dtrRegistration("UserName")) Then
lblError.Text = "User Name is not available. Please choose another User Name."
End If
Else
dtrRegistration.Close()
cnnRegistration.Close()
strSQL = "INSERT INTO tblUsers " & _
"(" & _
"[UserName], [Password], [FirstName], [LastName] ," & _
"[Address], [Suburb], [City], [State], [PostCode] ," & _
"[Country], [EMail], [Contact]" & _
") VALUES (" & _
"'" & txtUserName.Text & "', '" & txtPassword.Text & "', " & _
"'" & txtFirstName.Text & "', '" & txtLastName.Text & "', " & _
"'" & txtAddress.Text & "', '" & txtSuburb.Text & "', " & _
"'" & txtCity.Text & "', '" & txtState.Text & "', " & _
"'" & txtPostCode.Text & "', '" & txtCountry.Text & "', " & _
"'" & txtEMail.Text & "', '" & txtContact.Text & "')"
cmdRegistration = New SqlCommand(strSQL, cnnRegistration)
cnnRegistration.Open()
If ValidateEntry(txtUserName.Text, txtPassword.Text, txtFirstName.Text, _
txtLastName.Text, txtAddress.Text, txtSuburb.Text, _
txtCity.Text, txtState.Text, txtPostCode.Text, _
txtCountry.Text, txtEMail.Text) = True Then
dtrRegistration = cmdRegistration.ExecuteReader
lblError.Text = "Registration successful...Please go to Login page to gain access."
End If
End If
dtrRegistration.Close()
cnnRegistration.Close()
End Sub
Private Function ValidateEntry(ByVal s1 As String, _
ByVal s2 As String, _
ByVal s3 As String, _
ByVal s4 As String, _
ByVal s5 As String, _
ByVal s6 As String, _
ByVal s7 As String, _
ByVal s8 As String, _
ByVal s9 As String, _
ByVal s10 As String, _
ByVal s11 As String) As Boolean
If s1 = "" Then
lblError.Text = "*UserName is REQUIRED."
ValidateEntry = False
Else
If s2 = "" Then
lblError.Text = "*Password is REQUIRED."
ValidateEntry = False
Else
If s3 = "" Then
lblError.Text = "*FirstName is REQUIRED."
ValidateEntry = False
Else
If s4 = "" Then
lblError.Text = "*LastName is REQUIRED."
ValidateEntry = False
Else
If s5 = "" Then
lblError.Text = "*Address is REQUIRED."
ValidateEntry = False
Else
If s6 = "" Then
lblError.Text = "*Suburb is REQUIRED."
ValidateEntry = False
Else
If s7 = "" Then
lblError.Text = "*City is REQUIRED."
ValidateEntry = False
Else
If s8 = "" Then
lblError.Text = "*State is REQUIRED."
ValidateEntry = False
Else
If s9 = "" Then
lblError.Text = "*PostCode is REQUIRED."
ValidateEntry = False
Else
If s10 = "" Then
lblError.Text = "*Country is REQUIRED."
ValidateEntry = False
Else
If s11 = "" Then
lblError.Text = "*EMail is REQUIRED."
ValidateEntry = False
Else
If Len(s5) > 100 Then
lblError.Text = "*Address can not be more than 100 characters."
ValidateEntry = False
Else
ValidateEntry = True
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End Function
I am getting this error...
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...
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
txtUserName.Text = ""
txtPassword.Text = ""
txtFirstName.Text = ""
txtLastName.Text = ""
txtAddress.Text = ""
txtSuburb.Text = ""
txtCity.Text = ""
txtState.Text = ""
txtPostCode.Text = ""
txtCountry.Text = "Australia"
txtEMail.Text = ""
txtContact.Text = ""
End If
End Sub
Private Sub cmdReset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdReset.Click
txtUserName.Text = ""
txtPassword.Text = ""
txtFirstName.Text = ""
txtLastName.Text = ""
txtAddress.Text = ""
txtSuburb.Text = ""
txtCity.Text = ""
txtState.Text = ""
txtPostCode.Text = ""
txtCountry.Text = "Australia"
txtEMail.Text = ""
txtContact.Text = ""
End Sub
Private Sub cmdSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSubmit.Click
Dim cnnRegistration As SqlConnection
Dim cmdRegistration As SqlCommand
Dim dtrRegistration As SqlDataReader
Dim strSQL As String
cnnRegistration = New SqlConnection("server=WRACK\SQLDB;uid=sa;pwd=;database=NW;")
strSQL = "SELECT [UserName] FROM tblUsers Where UserName = '" & txtUserName.Text & "' ORDER BY [UserName]"
cmdRegistration = New SqlCommand(strSQL, cnnRegistration)
cnnRegistration.Open()
dtrRegistration = cmdRegistration.ExecuteReader
If dtrRegistration.Read() Then
If Trim(txtUserName.Text) = Trim(dtrRegistration("UserName")) Then
lblError.Text = "User Name is not available. Please choose another User Name."
End If
Else
dtrRegistration.Close()
cnnRegistration.Close()
strSQL = "INSERT INTO tblUsers " & _
"(" & _
"[UserName], [Password], [FirstName], [LastName] ," & _
"[Address], [Suburb], [City], [State], [PostCode] ," & _
"[Country], [EMail], [Contact]" & _
") VALUES (" & _
"'" & txtUserName.Text & "', '" & txtPassword.Text & "', " & _
"'" & txtFirstName.Text & "', '" & txtLastName.Text & "', " & _
"'" & txtAddress.Text & "', '" & txtSuburb.Text & "', " & _
"'" & txtCity.Text & "', '" & txtState.Text & "', " & _
"'" & txtPostCode.Text & "', '" & txtCountry.Text & "', " & _
"'" & txtEMail.Text & "', '" & txtContact.Text & "')"
cmdRegistration = New SqlCommand(strSQL, cnnRegistration)
cnnRegistration.Open()
If ValidateEntry(txtUserName.Text, txtPassword.Text, txtFirstName.Text, _
txtLastName.Text, txtAddress.Text, txtSuburb.Text, _
txtCity.Text, txtState.Text, txtPostCode.Text, _
txtCountry.Text, txtEMail.Text) = True Then
dtrRegistration = cmdRegistration.ExecuteReader
lblError.Text = "Registration successful...Please go to Login page to gain access."
End If
End If
dtrRegistration.Close()
cnnRegistration.Close()
End Sub
Private Function ValidateEntry(ByVal s1 As String, _
ByVal s2 As String, _
ByVal s3 As String, _
ByVal s4 As String, _
ByVal s5 As String, _
ByVal s6 As String, _
ByVal s7 As String, _
ByVal s8 As String, _
ByVal s9 As String, _
ByVal s10 As String, _
ByVal s11 As String) As Boolean
If s1 = "" Then
lblError.Text = "*UserName is REQUIRED."
ValidateEntry = False
Else
If s2 = "" Then
lblError.Text = "*Password is REQUIRED."
ValidateEntry = False
Else
If s3 = "" Then
lblError.Text = "*FirstName is REQUIRED."
ValidateEntry = False
Else
If s4 = "" Then
lblError.Text = "*LastName is REQUIRED."
ValidateEntry = False
Else
If s5 = "" Then
lblError.Text = "*Address is REQUIRED."
ValidateEntry = False
Else
If s6 = "" Then
lblError.Text = "*Suburb is REQUIRED."
ValidateEntry = False
Else
If s7 = "" Then
lblError.Text = "*City is REQUIRED."
ValidateEntry = False
Else
If s8 = "" Then
lblError.Text = "*State is REQUIRED."
ValidateEntry = False
Else
If s9 = "" Then
lblError.Text = "*PostCode is REQUIRED."
ValidateEntry = False
Else
If s10 = "" Then
lblError.Text = "*Country is REQUIRED."
ValidateEntry = False
Else
If s11 = "" Then
lblError.Text = "*EMail is REQUIRED."
ValidateEntry = False
Else
If Len(s5) > 100 Then
lblError.Text = "*Address can not be more than 100 characters."
ValidateEntry = False
Else
ValidateEntry = True
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End Function
I am getting this error...