Test If HttpContext.Current.Application("var") exists (vb.net)

Discussion in 'ASP .Net' started by gn, Feb 20, 2005.

  1. gn

    gn Guest

    I am a VB.Net newbie and have tried to search for this answer without
    success - What is the exact syntax to test if
    HttpContext.Current.Application("var") exists in vb.net

    I have tried:

    If (HttpContext.Current.Application("var").ToString) <> "" Then

    That gives me System.NullReferenceException: Object reference not set
    to an instance of an object Error, I suspect because I am trying to
    convert nothing into a string??

    If HttpContext.Current.Application("var") is null then

    Didn't like that either, syntax checker said I should use system.DBnull
    since 'null' is no longer supported??

    I am sure I am missing something very simple, could someone please give
    me a nudge in the right direction?

    Thanks
     
    gn, Feb 20, 2005
    #1
    1. Advertisements

  2. gn

    Guest Guest

    Guest, Feb 20, 2005
    #2
    1. Advertisements

  3. gn

    AZNewsh Guest

    Duh!

    I think I am in need of a rest, I knew that!


    Thank you for saving me from myself
     
    AZNewsh, Feb 21, 2005
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.