Tammu
asked on
What does this error mean in asp.net 2.0 and C#
My site is built in ASP.NET 2.0 and C# using SQL 2005 Database. I am writing all the error to my db in table called Exceptions.
Lately I have noticed that on my Products page, this error keeps getting written to the Exception table a lot. And I am not able to replicate it, if I want to check it out.
in products.aspx.cs line 68 is
and line 547
any advice or suggestions are appreciated
Lately I have noticed that on my Products page, this error keeps getting written to the Exception table a lot. And I am not able to replicate it, if I want to check it out.
System.NullReferenceException: Object reference not set to an instance of an object. at MySite.products.showItems(Int32 pageIndex) in c:\Websites\gn4f4ada\browse\products.aspx.cs:line 547 at MySite.products.Page_Load(Object sender, EventArgs e) in c:\Websites\gn4f4ada\browse\products.aspx.cs:line 68
in products.aspx.cs line 68 is
try
{
if (!this.IsPostBack)
{
this.CategoryId = Convert.ToInt32(Request[REQ_CATEGORY_ID]);
this.showItems(this.PageIndex); // THIS IS LINE 68
}
}
catch (Exception ex)
{
this.HandlePageError(ex);
}
and line 547
private void showItems(int pageIndex)
{
Category view;
if (SelectedSize > -1)
{
view = this.CurrentCategory.GetView(
(SizeType)SelectedSize,
(Gender)SelectedGender);
}
else
{
if (SelectedGender > 0)
{
view = this.CurrentCategory.GetView((Gender)SelectedGender);
}
else
{
view = this.CurrentCategory;
}
}
this.pager.SetPagingLabels(view.ItemCount); // THIS IS LINE 547
if (this.ViewMode == MySitePage.ViewMode.Paged)
{
this.rProducts.DataSource = view.GetPage(pageIndex, this.pager.PageSize);
}
else
{
this.rProducts.DataSource = view.Items;
}
this.rProducts.DataBind();
}
any advice or suggestions are appreciated
Is either pager or view null at the point the exception is raised? Have you tried stepping through your code?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The problem is I am not able to replicate it. It only shows up in the Exception Table
That's because you're doing error handling.
ASKER
Thanks