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

G

gn

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
 
A

AZNewsh

Duh!

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


Thank you for saving me from myself
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top