Solved

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

Posted on 2009-05-11
3
777 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

734 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