PC Review


Reply
Thread Tools Rate Thread

Object reference not set to an instance of an object.

 
 
=?Utf-8?B?UmFlZCBTYXdhbGhh?=
Guest
Posts: n/a
 
      24th Mar 2005
Hello,
we developed an ASP.NET Application, then our QA Dept make a full QA in all
pages with all possible cases, after deployment and review the error log we
noticed that many of errors which make page to be crashed refered to error
(Object reference not set to an instance of an object.)

so , what is the best techniques to avoid such errors in advance?
or in other to eliminate occurence such error, because our log if filled
with it

Regards
 
Reply With Quote
 
 
 
 
Sharon
Guest
Posts: n/a
 
      24th Mar 2005
Hi Raed.
NullReferenceException is thrown, when you try to use an
instance of a reference type, that is null or nothing in VB.
You should check that the instance is not null, before you preform any
operation on it.

C#
if(instanceName == null)
{
Response.Write("error");
}

VB
if instanceName is nothing then
Response.Write("error")
end if

Hope this helps.
Sharon.


"Raed Sawalha" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello,
> we developed an ASP.NET Application, then our QA Dept make a full QA in

all
> pages with all possible cases, after deployment and review the error log

we
> noticed that many of errors which make page to be crashed refered to error
> (Object reference not set to an instance of an object.)
>
> so , what is the best techniques to avoid such errors in advance?
> or in other to eliminate occurence such error, because our log if filled
> with it
>
> Regards



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Object reference not set to an instance of an object" Weird thing happens with reference a link nguyentrongkha@gmail.com Microsoft ASP .NET 1 20th Sep 2007 10:46 PM
Error "object reference not set to instance of an object" when trying to set datasource property of a bound column in datagrid control Martin Widmer Microsoft VB .NET 0 23rd Jan 2006 10:24 AM
"Object reference not set to an instance of an object" Kam Microsoft Dot NET Framework 4 9th Jan 2004 12:44 PM
Object Reference Not Set to an Instance of an Object JC Microsoft Dot NET Framework 1 25th Sep 2003 07:44 PM
Object reference not set to an instance of an object- Dianna K Microsoft Dot NET Framework 2 17th Aug 2003 01:35 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:31 PM.