Server Error in '/' Application.

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

Source Error:


Line 269:        mysort.SortPanelSetup()
Line 270:
Line 271:        RepRcpSearch.DataSource = RecipeCardList.GetByContributor(CurrentSearch, CType(pglstrcp.CurrentPage - 1, Integer), PageSize, mysort.SortBy, "")
Line 272:        RepRcpSearch.DataBind()
Line 273:

Source File: D:\Webroot\td2k8r2-64\tdcpreview.dytelworld.com\MyRecipes.aspx.vb    Line: 271

Stack Trace:


[InvalidCastException: Conversion from type 'DBNull' to type 'Single' is not valid.]
   Microsoft.VisualBasic.CompilerServices.Conversions.ToSingle(Object Value, NumberFormatInfo NumberFormat) +449659
   Microsoft.VisualBasic.CompilerServices.Conversions.ToSingle(Object Value) +6
   RecipeCardList.GetByContributor(Int64 contributorid, Int32 nPageNo, Int32 nPageSize, Int32 sortby, String limittorcp) +805
   MyRecipes.Page_Load(Object sender, EventArgs e) in D:\Webroot\td2k8r2-64\tdcpreview.dytelworld.com\MyRecipes.aspx.vb:271
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627


Version Information: Microsoft .NET Framework Version:2.0.50727.5485; ASP.NET Version:2.0.50727.5491