A field or property with the name 'JudgeTime' was not found on the selected data source.

ggzgeguoz 2008-07-16 05:52:26
Server Error in '/zxks' Application.
--------------------------------------------------------------------------------

A field or property with the name 'JudgeTime' was not found on the selected data source.
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.Web.HttpException: A field or property with the name 'JudgeTime' was not found on the selected data source.

Source Error:


Line 52: {
Line 53: GridView1.DataSource = ds;
Line 54: GridView1.DataBind(); (出错行)
Line 55: }
Line 56: else


Source File: e:\MyOnLineExam\Web\StudentIndex.aspx.cs Line: 54

Stack Trace:


[HttpException (0x80004005): A field or property with the name 'JudgeTime' was not found on the selected data source.]
System.Web.UI.WebControls.BoundField.GetValue(Control controlContainer) +432
System.Web.UI.WebControls.BoundField.OnDataBindField(Object sender, EventArgs e) +60
System.Web.UI.Control.OnDataBinding(EventArgs e) +98
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +208
System.Web.UI.Control.DataBind() +12
System.Web.UI.Control.DataBindChildren() +212
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +218
System.Web.UI.Control.DataBind() +12
System.Web.UI.WebControls.GridView.CreateRow(Int32 rowIndex, Int32 dataSourceIndex, DataControlRowType rowType, DataControlRowState rowState, Boolean dataBind, Object dataItem, DataControlField[] fields, TableRowCollection rows, PagedDataSource pagedDataSource) +221
System.Web.UI.WebControls.GridView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) +3013
System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +59
System.Web.UI.WebControls.GridView.PerformDataBinding(IEnumerable data) +12
System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +111
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +25
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +68
System.Web.UI.WebControls.GridView.DataBind() +4
Web_StudentIndex.ScoreInitData() in e:\MyOnLineExam\Web\StudentIndex.aspx.cs:54
Web_StudentIndex.Page_Load(Object sender, EventArgs e) in e:\MyOnLineExam\Web\StudentIndex.aspx.cs:19
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +13
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +45
System.Web.UI.Control.OnLoad(EventArgs e) +98
System.Web.UI.Control.LoadRecursive() +71
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4310




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42




请问,这是什么原因引起的,该如何解决?
...全文
427 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
gubaochao1984 2009-12-27
  • 打赏
  • 举报
回复
我估计在GridView1中,先后绑定多个不同数据源了
ggzgeguoz 2008-07-17
  • 打赏
  • 举报
回复
感谢大家哦,但你们回答我好像都不存在.是不是我没有说清楚还是需我再提供什么信息给各位分析呢?

注:我是一点都不会这些语句,我是找了一个我们公司可以用的源程序,打算修改后自用的.还请各位见谅,多帮助一下.
江城老温 2008-07-16
  • 打赏
  • 举报
回复
GridView1里应该有JudgeTime这样的一个列名。但是在你要绑定的数据源ds里没有这样的数据。
wxg22526451 2008-07-16
  • 打赏
  • 举报
回复
搜索下用到'JudgeTime' 这个字段的地方去掉或修改
wxg22526451 2008-07-16
  • 打赏
  • 举报
回复
绑定的数据源中没有找到'JudgeTime' 这个字段
tootto 2008-07-16
  • 打赏
  • 举报
回复
数据绑定时出错,JudgeTime不存在,是不是拼写错误,或者页面文件绑定表达式有错误。
hongqi162 2008-07-16
  • 打赏
  • 举报
回复
JudgeTime在你的结果集里没有找到,你的GridView1设置里面使用了这个名字,所以绑定的时候出错了,检查一下吧

62,243

社区成员

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

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

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

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