Re: Checking for null
From: D. Shane Fowlkes (shanefowlkes_at_hotmail.com)
Date: 11/22/04
- Next message: Chris Kettenbach: "Code Behind Question"
- Previous message: Paul Clement: "Re: How secure is MSAccess?"
- In reply to: Andy G: "Checking for null"
- Next in thread: Andy G: "Re: Checking for null"
- Reply: Andy G: "Re: Checking for null"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 22 Nov 2004 14:37:40 -0500
Just a guess but have you tried IsNothing?
If IsNothing(yadda) = True Then
Do Something
End If
"Andy G" <ajgould@iastate.edu> wrote in message
news:OHPL5kM0EHA.632@TK2MSFTNGP10.phx.gbl...
> 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: Chris Kettenbach: "Code Behind Question"
- Previous message: Paul Clement: "Re: How secure is MSAccess?"
- In reply to: Andy G: "Checking for null"
- Next in thread: Andy G: "Re: Checking for null"
- Reply: Andy G: "Re: Checking for null"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|