Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MmType.IsEmpty
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
MmType.IsEmpty
Environment versions
Environment:
C# 2.0
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01144991
Message ID:
01144991
Views:
71
I have an integer field that is a foreign key for another table. When I get a new dataset, I want to see if that field is not null and, if not, display the description from the foreign table. I tried using:
if (!mmType.IsEmpty(pe.parish)) but when the field is null, I get an error "Object Reference is not set to an instance of an object" and when I put pe.parish in the watch window, it says "pe.parish threw an exception of type System.NullReferenceException. It is a nullable field and the business entity object identifies it as such. I assume I need to test for the value being null first but when I check to see if pe.parish == null, it says I can't use that with an integer.

I also tried if (!mmType.Equals(pe.parish, null)) but didn't have any better luck.

Any suggestions?

Thanks.

Linda
Linda Harmes
HiBit Technologies, Inc.
Next
Reply
Map
View

Click here to load this message in the networking platform