Server Error in '/' Application.

Conversion from type 'DBNull' to type 'Currency' is not valid.

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.InvalidCastException: Conversion from type 'DBNull' to type 'Currency' is not valid.

Source Error:


Line 519:		litGroupNameBreadcrumb.text = "<li>" & litDiscussionTitle.text & "</li>"
Line 520:		litHeader.text = "<i class=""fas fa-" & GetCategoryIcon(cat_id) & """></i><a href=""postmessage.aspx?cat_id=" & cat_id & """><i class=""fas fa-plus button_right""> <span class=""hide-for-small-only"">START </span>NEW</i></a> " & litDiscussionTitle.text
Line 521:		litCatStats.text = objDR("cat_desc") & "<br/><br/>" & litCatStats.text & "<br/><strong>Total posts</strong>: " & FormatNumber(objDR("cat_postcount"),0)
Line 522:
Line 523:

Source File: C:\sites\ebrandon\group_discussion.aspx    Line: 521

Stack Trace:


[InvalidCastException: Conversion from type 'DBNull' to type 'Currency' is not valid.]
   Microsoft.VisualBasic.Strings.FormatNumber(Object Expression, Int32 NumDigitsAfterDecimal, TriState IncludeLeadingDigit, TriState UseParensForNegativeNumbers, TriState GroupDigits) +720937
   ASP.group_discussion_aspx.DoGroupDetails(String cat_id) in C:\sites\ebrandon\group_discussion.aspx:521
   ASP.group_discussion_aspx.Page_Load(Object Src, EventArgs E) in C:\sites\ebrandon\group_discussion.aspx:80
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
   System.Web.UI.Control.OnLoad(EventArgs e) +132
   System.Web.UI.Control.LoadRecursive() +66
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428


Version Information: Microsoft .NET Framework Version:2.0.50727.8793; ASP.NET Version:2.0.50727.8762