I have a custom validator which does some server side validation:
The problem is no matter what I do, objResult always is returning false and I can't figure out why. In my XSD file, the qta.udf_ExistsDuplicateCompanyName(strLegalNameNew) points to a stored prodedure that returns a bit. When I test the procedure in the XSD file interface, it shows that it returns Type Object with the value of either True or False as it should.
But when I step through the code in VS debugger, objResult does not return the right value (always false). I tried makeing objResult an int and a boolean, and also changed the corresponding data return type in my stored procedure, but it didn't work..
ok...I call UNCLE already.....
what gives here?
Code:
Protected Sub cvDuplicateName_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles cvDuplicateName.ServerValidate
Dim strLegalNameNew As Object = Me.txtLegalNameNew.Text
Dim qta As New QueriesTableAdapter
Dim objResult As Object = qta.udf_ExistsDuplicateCompanyName(strLegalNameNew)
'Dim bool As Boolean = qta.udf_ExistsDuplicateCompanyName(strLegalNameNew)
' Dim int As Integer = qta.udf_ExistsDuplicateCompanyName(strLegalNameNew)
If objResult = True Then
args.IsValid = "false"
Else
args.IsValid = "true"
End If
End Sub
The problem is no matter what I do, objResult always is returning false and I can't figure out why. In my XSD file, the qta.udf_ExistsDuplicateCompanyName(strLegalNameNew) points to a stored prodedure that returns a bit. When I test the procedure in the XSD file interface, it shows that it returns Type Object with the value of either True or False as it should.
But when I step through the code in VS debugger, objResult does not return the right value (always false). I tried makeing objResult an int and a boolean, and also changed the corresponding data return type in my stored procedure, but it didn't work..
ok...I call UNCLE already.....
what gives here?