hey friends....i need your help
while compiling browsearticles.aspx from the downloaded code (TBH) i am facing a problem which is copied here
Source Error:
Line 105: protected virtual ArticleDetails GetArticleFromReader(IDataReader reader, bool readBody)
Line 106: {
Line 107: ArticleDetails article = new ArticleDetails(
Line 108: :(:((int)reader["ArticleID"],
Line 109: (DateTime)reader["AddedDate"],
Source File: d:\final project\my website\App_Code\DAL\ArticlesProvider.cs Line: 107
Stack Trace:
[InvalidCastException: Specified cast is not valid.]
MS.Institute4Idea.DAL.ArticlesProvider.GetArticleF romReader(IDataReader reader, Boolean readBody) in d:\final project\my website\App_Code\DAL\ArticlesProvider.cs:107
MS.Institute4Idea.DAL.ArticlesProvider.GetArticleC ollectionFromReader(IDataReader reader, Boolean readBody) in d:\final project\my website\App_Code\DAL\ArticlesProvider.cs:146
MS.Institute4Idea.DAL.SqlClient.SqlArticlesProvide r.GetPublishedArticles(DateTime currentDate, Int32 pageIndex, Int32 pageSize) in d:\final project\my website\App_Code\DAL\SqlClient\SqlArticlesProvider .cs:184
MS.Institute4Idea.BLL.Articles.Article.GetArticles (Boolean publishedOnly, Int32 startRowIndex, Int32 maximumRows) in d:\final project\my website\App_Code\BLL\Articles\Article.cs:394
MS.Institute4Idea.BLL.Articles.Article.GetArticles (Boolean publishedOnly, Int32 categoryID, Int32 startRowIndex, Int32 maximumRows) in d:\final project\my website\App_Code\BLL\Articles\Article.cs:415
i tried many things including
(reader["ArticleID"] == DBNull.Value ? 0 : (int)reader["ArticleID"]),
but nothing worked...i am totally trapped and gone out of my mind to understand this problem.
please suggest me possible solution and if not plz suggest possible problem so that i can start thinking process again
mahesh