i got runtime error when is send register form: My code:
If IsPostBack Then
Dim errorText As String = ""
Dim formName As String = "register"
Dim _username As String = MyUtils.setme(username.Text)
Dim _fname As String = MyUtils.setme(fname.Text)
Dim _password As String = MyUtils.setme(password.Text)
Dim _tel As String = MyUtils.setme(tel.Text)
Dim _street As String = MyUtils.setme(street.Text)
Dim _street_no As String = MyUtils.setme(street_no.Text)
Dim _city As String = MyUtils.setme(city.Text)
Dim ds As New DataSet
ds = MyUtils.runMSSQL_DS("select num from buyers where username='" & _username & "'")
If MyUtils.isSpam(formName) Then
errorText = "test1"
ElseIf _fname = "" Then
errorText = "test2"
ElseIf _tel.Length < 7 Or _tel.Length > 11 Then
errorText = "test3"
ElseIf MyUtils.checkEmail(_username) = False Then
errorText = "test4"
ElseIf _password.Length < 4 Then
errorText = "test5"
Else
If ds.Tables(0).Rows.Count > 0 Then
errorText = "test6"
End If
End If
End If
I got error: System.NullReferenceException on line errorText = "test2"
what i need to do?
*edit: not its not duplicate because its Specific code that i got this error, i read before what is it NullReferenceException and all the answers dont helped me.