Solved

object is null

Posted on 2004-08-09
3
306 Views
Last Modified: 2010-04-15
I would like to know if there is a method or something that I could inherit that would tell me if my object is null or not?  i.e. all of the properties are empty and have not been set.
0
Comment
Question by:jayrod
3 Comments
 
LVL 9

Expert Comment

by:tinchos
ID: 11756430
If an object is null, you cannot access its methods, properties or attributes

In order to know if an object is null you would do

object myObj;

// Code

if( myObj is null )
{
    // myObj is null
}
else
{
    // myObj is not null
}

Hope this helps

Tincho
0
 
LVL 7

Expert Comment

by:psdavis
ID: 11756661
if( myObj == null )
...
0
 
LVL 20

Accepted Solution

by:
ihenry earned 250 total points
ID: 11759618
I'm not sure I understand your problem, but maybe you can use this

INullable Interface
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemDataSqlTypesINullableClassTopic.asp
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now