System.NullReference

  • Thread starter Thread starter Arvind
  • Start date Start date
A

Arvind

Hi,

How do u handle this error other than
Try
Catch method, is there anything like isDBNull() or something on those
like so that i can check for the value of the object and take some
action as there are lot of activities that follow after checking of a
perticular component.

Thanks
Arvind,
 
Arvind said:
How do u handle this error other than
Try
Catch method, is there anything like isDBNull() or something on
those like so that i can check for the value of the object and take
some action as there are lot of activities that follow after checking
of a perticular component.

To avoid System.NullReferenceException:

If Value Is Nothing Then


To check Null values in/from a database:

If Value Is DBNull.Value Then


DBNull is not Nothing. See recent discussions in this group, e.g. "How can
an integer contain a Null value".
 
Thanks Armin,

I have tried all the those things which u have mentioned still am
getting the same exception, i.e. the reason i posted.

Thanks
Arvind.
 
Arvind P Rangan said:
I have tried all the those things which u have mentioned still am
getting the same exception, i.e. the reason i posted.

Please post some code.
 
Armin,

This is in reference with ADS
If any of the ADS attribute does not have value how do u check it.
With ISNothing.. or other things its jst raising
system.NullReferenceException.

Thanks
Arvind.
 
Arvind P Rangan said:
This is in reference with ADS

What is ADS?
If any of the ADS attribute does not have value how do u check it.
With ISNothing.. or other things its jst raising
system.NullReferenceException.

Sorry, I don't understand you. To know how you can avoid the exception, at
least I have to see the line of code. As I said, to check if a variable
contains Nothing, use "If variable Is Nothing Then".
 
Armin,
ADS = Active Directory Service
There are few attributes associated with it. i am trying to capture
thosse values and few attributes dont have values i.e when this error is
occuring.

Thanks
aRvind.
 
Back
Top