I have modified the New Articles Part to work with our already in place database running on M$SQL 2000.
Everything seems to work so far until I try to visit the browsearticles.aspx and i get:
Exception Details: System.InvalidCastException: Specified cast is not valid.
Source Error:
Line 102: protected virtual ArticleDetails GetArticleFromReader(IDataReader reader, bool readBody)
Line 103: {
Line 104: ArticleDetails article = new ArticleDetails(
Line 105: (int)reader["HID"],
Line 106: (DateTime)reader["CreatedDate"],
Source File: d:\PubDev\App_Code\DAL\ArticlesProvider.cs Line: 104
Stack Trace:
[InvalidCastException: Specified cast is not valid.]
MB.Summit.DAL.ArticlesProvider.GetArticleFro mReader(IDataReader reader, Boolean readBody) in d:\PubDev\App_Code\DAL\ArticlesProvider.cs:104
MB.Summit.DAL.ArticlesProvider.GetArticleCol lectionFromReader(IDataReader reader, Boolean readBody) in d:\PubDev\App_Code\DAL\ArticlesProvider.cs:137
MB.Summit.DAL.SqlClient.SqlArticlesProvider. GetArticles(Int32 groupID, Int32 pageIndex, Int32 pageSize) in d:\PubDev\App_Code\DAL\SqlClient\SqlArticlesProvid er.cs:152
MB.Summit.BLL.Articles.Article.GetArticles(I nt32 groupID, Int32 startRowIndex, Int32 maximumRows) in d:\PubDev\App_Code\BLL\Articles\Article.cs:353
Here is the code that it is pointing to:
protected virtual ArticleDetails GetArticleFromReader(IDataReader reader, bool readBody)
{
ArticleDetails article = new ArticleDetails(
(int)reader["HID"],
(DateTime)reader["CreatedDate"],
(int)reader["GroupID"],
reader["GroupTitle"].ToString(),
reader["Subject"].ToString(),
reader["FPIntroText"].ToString(),
reader["Body"].ToString(),
reader["LCategory"].ToString(),
reader["SubCategory"].ToString(),
reader["CreatedByFullName"].ToString(),
(DateTime)reader["ModifiedDate"],
reader["Filename"].ToString(),
(int)reader["NewsType"],
(int)reader["JobLevel"]);
if (readBody)
article.Body = reader["Body"].ToString();
return article;
Any Help would be greatly appreciated!
URL of error is:
http://dev.summitcomputer.net/BrowseArticles.aspx