473,378 Members | 1,351 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

System.NullReference

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,

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #1
6 2893
"Arvind" <ar******@hotmail.com> schrieb
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".
--
Armin

Nov 20 '05 #2
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.

Armin Zingler wrote:
"Arvind" <ar******@hotmail.com> schrieb
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".


Nov 20 '05 #3
"Arvind P Rangan" <ar******@hotmail.com> schrieb

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

Nov 20 '05 #4
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.
Armin Zingler wrote:
"Arvind P Rangan" <ar******@hotmail.com> schrieb
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.


Nov 20 '05 #5
"Arvind P Rangan" <ar******@hotmail.com> schrieb

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

Nov 20 '05 #6
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.
Armin Zingler wrote:
"Arvind P Rangan" <ar******@hotmail.com> schrieb
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".


Nov 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: sergi | last post by:
Hi there, I am getting a System.NullReference exception when calling an unmanaged method CreateClassEnumerator. I am really new to Interop, so that I am having trouble finding out a solution....
2
by: Larry Re | last post by:
I've written a small C# app which appears to work perfectly except for the fact that I get a NullReference exception when I close the form using the red 'X' in the upper right hand corner of the...
11
by: Andreas Wirén | last post by:
Hi I'm a C# .NET newbie doing a minor school project but I'm getting a strange error message. 'System.NullReferenceException' occurred in system.windows.forms.dll Additional information: Object...
5
by: Vitling | last post by:
For no apparent reason, a NullReference exception is thrown in system.dll (System.Net.Sockets.OverlappedAsyncResult.CompletionPortCallback). Since I only get a disassembly from Visual Studio, it...
0
by: studio60podcast | last post by:
I'm defining the ItemUpdating event for a DetailsView control, but when I try to access the e.NewValues collection, it's throwing a NULLReference exception. Any thoughts? <asp:DetailsView...
1
by: Rama Jayapal | last post by:
i have written the following code to call a method in a class like in the aspx.cs page List<string> surls = new List<string>(); Cweb.GetMainUrls(document,ref surls); Response.Write(surls); ...
4
by: yogarajan | last post by:
hi i had developed pop3 Account mail view in my web page but i got error in (System.NullReference Exception: Object reference not set) NetStrm.Write(szData, 0, szData.Length); - this line ...
0
by: =?Utf-8?B?RGlzcEV2ZW50QWR2aXNlIGZhaWxzIHdpdGggMHg4 | last post by:
Hi, I have a beginner's question and I'm not even sure whether it's an asp question, an Exchange server question or an x64 question... I've been experimenting with HttpModules. I want to use one in...
2
by: ganeshvkl | last post by:
i got error " An unhandled exception of type 'System.NullReferenceException' occurred in system.data.dll " when i run my VB.net 2003 with Sqlserver 2000 server program , the same program is working...
6
by: Steve | last post by:
Hi All I have a windows forms Application (SAM) in vb.net 2008 using .net framework V2 One and only one customer out of 30 customers is getting errors daily where they have to close and...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.