Re: Checking for null

From: D. Shane Fowlkes (shanefowlkes_at_hotmail.com)
Date: 11/22/04


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
>
>
>
>



Relevant Pages

  • Re: WSE 3.0, usernameOverTransportSecurity, custom Token Manager w/ securityTokenManager,
    ... Microsoft.Web.Services3.Security.Security security) ... throw new Exception("The username token is not present in the ... I've added the web service call directly to my Data binding method ... protected override string AuthenticateToken(UsernameToken ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: WSE 3.0, usernameOverTransportSecurity, custom Token Manager w/ securityTokenManager,
    ... Microsoft.Web.Services3.Security.Security security) ... This assertion is only valid to see whether you are receiving the username ... I've added the web service call directly to my Data binding method ... protected override string AuthenticateToken(UsernameToken token) ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: WSE 3.0, usernameOverTransportSecurity, custom Token Manager w/ securityTokenManager,
    ... Microsoft.Web.Services3.Security.Security security) ... This assertion is only valid to see whether you are receiving the username ... I've added the web service call directly to my Data binding method ... protected override string AuthenticateToken(UsernameToken token) ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • VB.net impersonation / credentials issues
    ... the fact I know that the passwords and username are correct. ... Dim x As New ListViewItem ... Private _username, _password, _domainname As String ... Public Sub New(ByVal username As String, ...
    (microsoft.public.dotnet.general)
  • Re: Irritating INSERT INTO Error
    ... Password is a reserved word in Access 2000 SQL. ... LastName, EMail, UserName,, Address, City, State, Country) ... Public Sub AddRecord(ByVal FirstName1 As String, ... Dim oledbCmd As OledbCommand ...
    (microsoft.public.dotnet.framework.aspnet)