“/”应用程序中的服务器错误。
--------------------------------------------------------------------------------指定的转换无效。 
说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.InvalidCastException: 指定的转换无效。源错误: 执行当前 Web 请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。  堆栈跟踪: 
[InvalidCastException: 指定的转换无效。]
   Hidistro.Membership.Data.UserData.GetAnonymousUser() in d:\我的项目\移动云商城\Hidistro.Membership.Data\UserData.cs:128
   Hidistro.Membership.Context.Users.GetAnonymousUser() in d:\我的项目\移动云商城\Hidistro.Membership.Context\Users.cs:47
   Hidistro.Membership.Context.Users.GetUser(Int32 userId, String username, Boolean isCacheable, Boolean userIsOnline) in d:\我的项目\移动云商城\Hidistro.Membership.Context\Users.cs:117
   Hidistro.Membership.Context.Users.GetUser() in d:\我的项目\移动云商城\Hidistro.Membership.Context\Users.cs:83
   Hidistro.Membership.Context.HiContext.get_User() in d:\我的项目\移动云商城\Hidistro.Membership.Context\HiContext.cs:298
   Hidistro.SaleSystem.Shopping.ShoppingCartProcessor.GetShoppingCart() in d:\我的项目\移动云商城\Hidistro.SaleSystem.Shopping\ShoppingCartProcessor.cs:174
   Hidistro.UI.SaleSystem.Tags.Common_ShoppingCart_Info.AttachChildControls() in d:\我的项目\移动云商城\Hidistro.UI.SaleSystem.Tags\Common_ShoppingCart_Info.cs:18
   Hidistro.UI.Common.Controls.AscxTemplatedWebControl.CreateChildControls() in d:\我的项目\移动云商城\Hidistro.UI.Common.Controls\AscxTemplatedWebControl.cs:24
   System.Web.UI.Control.EnsureChildControls() +83
   System.Web.UI.Control.PreRenderRecursiveInternal() +42
   System.Web.UI.Control.PreRenderRecursiveInternal() +155
   System.Web.UI.Control.PreRenderRecursiveInternal() +155
   System.Web.UI.Control.PreRenderRecursiveInternal() +155
   System.Web.UI.Control.PreRenderRecursiveInternal() +155
   System.Web.UI.Control.PreRenderRecursiveInternal() +155
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +974
 
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.0.30319.34209 

解决方案 »

  1.   

    GetAnonymousUser()方法里有个什么类型转换的地方报错,你查一下UserData.cs:128行位置
      

  2.   

    这个是第128行内容    int parameterValue = (int) this.database.GetParameterValue(sqlStringCommand, "UserId");谢谢!
      

  3.   

    这个是第128行内容    int parameterValue = (int) this.database.GetParameterValue(sqlStringCommand, "UserId");谢谢!
      

  4.   

    单步调试下 this.database.GetParameterValue(sqlStringCommand, "UserId")是什么值?
    如果是字母、符号等等,指定是不能转换成int型咯