Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2009-05-11
3
Medium Priority
?
780 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 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

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

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
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…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

715 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