Solved

VB.NET - checking to see if Session variable is nothing

Posted on 2009-05-11
3
767 Views
Last Modified: 2012-05-06
This is what I'm using...

If Session("PerformanceCategoryUnitList") <> Nothing Then

But when it isn't nothing it throws an error saying:
Operator '<>' is not defined for type 'DataRow()' and 'Nothing'.

It works fine for when the session is nothing.  What am I doing wrong here?
0
Comment
Question by:josephdaviskcrm
  • 2
3 Comments
 
LVL 48

Accepted Solution

by:
jpaulino earned 500 total points
ID: 24357977
Try instead
If Session("PerformanceCategoryUnitList") IsNot Nothing Then
 
0
 
LVL 9

Expert Comment

by:tillgeffken
ID: 24358011
See if the following code changes anything.

If Session("PerformanceCategoryUnitList") Is Nothing Then

Open in new window

0
 
LVL 9

Expert Comment

by:tillgeffken
ID: 24358021
Opps, typing slow today
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now