Solved

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

Posted on 2009-05-11
3
779 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

Technology Partners: 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

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

630 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