set @my_balance = select sum(savings_balance) from client_accounts where savings_balance > 0.00

July 25, 2007 under ASP.NET, C++, IIS

Today’s Daily WTF post was one of their funny screenshot articles and one of them struck me as being quite familiar:

IIS Error Message on a Diebold ATM

Die-hard readers of my blog may be thinking that based on the Diebold logo in the picture, that I’m reminded of one of my rants against slow Diebold ABMs. It’s not. That “Object reference not set to an instance of an object” ASP.NET error is the one that makes me shudder – more so, since this is a banking application.

Sometimes this is caused by trying to access variables and object beyond the current scope, but Visual Studio can notice these more often than not during a build. Where I really get nabbed is when trying to access a null object. Sure, sometimes it’s just a slight oversight on my part and I try to access an objects methods and properties without actually instantiating it first. Hey, it happens. Yet, often I find that an object doesn’t instantiate and I don’t find until much later….like runtime later. So I’m now conditioned to try to catch everything:

   MyCoolClass myobject = null;

   try
   {
      myobject = new MyCoolClass();
      myobject.someVoidMethod(SOME_CONSTANT);
   }
   catch (Exception ex)
   {
      Response.Write(ex.Message.ToString());
   }
   finally
   {
      myobject = null;
   }

That’s my two cents, anyway 😉

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
comments: 0 »

Leave a Reply

Your email address will not be published. Required fields are marked *

Comment

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>