Checking for null
From: Andy G (ajgould_at_iastate.edu)
Date: 11/22/04
- Next message: rj: "aspxpage\netscape"
- Previous message: Mark Rae: "Re: How secure is MSAccess?"
- Next in thread: D. Shane Fowlkes: "Re: Checking for null"
- Reply: D. Shane Fowlkes: "Re: Checking for null"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 22 Nov 2004 13:26:51 -0600
I'm getting this error...Operator is not valid for type 'DBNull' and string
"". What is happening is that I'm calling a stored procedure to use the
email address to recover a forgotten username. If the email does not exist
then I get the above error. After I execute the stored procedure I try and
apparenty this is not catching the error. Should I use a Try...Catch? What
is the correct way to check for nulls in ASP.NET?
If Not myCommand.Parameters("@LOGIN_NAME").Value = "" Then
returnLogin = myCommand.Parameters("@LOGIN_NAME").Value
Else
lblMessage.Text = "Email does not exist in system. Re-enter email or contact
BRM Support"
End If
- Next message: rj: "aspxpage\netscape"
- Previous message: Mark Rae: "Re: How secure is MSAccess?"
- Next in thread: D. Shane Fowlkes: "Re: Checking for null"
- Reply: D. Shane Fowlkes: "Re: Checking for null"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|