Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2009-05-11
3
Medium Priority
?
782 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 2000 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 Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

885 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