Thursday, March 22, 2012

Object reference not set to an instance of an object error

Hey again,

I'm getting this error for my calendar.aspx page.

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

The source of the error is here:


ArrayList aEvents = new ArrayList();
--> foreach (DataRow zRow in ds.Tables["events"].Rows) <--
{
DateTime compareDate = GetSafeDate(zRow["UNIT_EVENT_DATE"].ToString());
if (compareDate == d)

Any ideas how to solve this?

Cheers,
Evil Shirt NinjaEither ds is null, or it doesn't contan a table named "events".

0 comments:

Post a Comment