Creating Article Subcategories using ParentCategoryID

Last post 05-20-2009 5:00 PM by kabogo. 0 replies.

Sort Posts:

  • Creating Article Subcategories using ParentCategoryID

    05-20-2009, 5:00 PM
    • Member
      point Member
    • kabogo
    • Member since 08-07-2006, 3:22 PM
    • Posts 16

    I need to implement multiple categories for articles. I followed the recommendation of adding a ParentCategoryID to the db using the int field type. I have changed the Category.cs, CategoryDetails.cs, and ArticlesProvider.cs files as needed and sucessfully built the solution. Upon running the site I receive the System.InvalidCastException detailed below;
     

    Line 78:         protected virtual CategoryDetails GetCategoryFromReader(IDataReader reader)
    Line 79:         {
    Line 80:             return new CategoryDetails(                
    Line 81:                (int)reader["CategoryID"],
    Line 82:                (int)reader["ParentID"],
     
    

    I must be overlooking something. Any help would be greatly appreciated.

    Cheers

Page 1 of 1 (1 items)