异常详细信息: System.InvalidCastException: 指定的转换无效。

GUOBAIMALL 2016-03-04 02:59:21
“/”应用程序中的服务器错误。
--------------------------------------------------------------------------------

指定的转换无效。
说明: 执行当前 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
...全文
340 6 打赏 收藏 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
江南小鱼 2016-03-05
  • 打赏
  • 举报
回复
单步调试下
 this.database.GetParameterValue(sqlStringCommand, "UserId")
是什么值? 如果是字母、符号等等,指定是不能转换成int型咯
GUOBAIMALL 2016-03-04
  • 打赏
  • 举报
回复
这个是第128行内容 int parameterValue = (int) this.database.GetParameterValue(sqlStringCommand, "UserId"); 谢谢!
GUOBAIMALL 2016-03-04
  • 打赏
  • 举报
回复
这个是第128行内容 int parameterValue = (int) this.database.GetParameterValue(sqlStringCommand, "UserId"); 谢谢!
GUOBAIMALL 2016-03-04
  • 打赏
  • 举报
回复
好的,感谢!我发v第128行,麻烦您帮忙看看。
xdashewan 2016-03-04
  • 打赏
  • 举报
回复
GetAnonymousUser()方法里有个什么类型转换的地方报错,你查一下UserData.cs:128行位置
GUOBAIMALL 2016-03-04
  • 打赏
  • 举报
回复
感谢高手指教!谢谢!

62,270

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧