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 
请问,这是什么原因引起的,该如何解决?

解决方案 »

  1.   

    JudgeTime在你的结果集里没有找到,你的GridView1设置里面使用了这个名字,所以绑定的时候出错了,检查一下吧
      

  2.   

    数据绑定时出错,JudgeTime不存在,是不是拼写错误,或者页面文件绑定表达式有错误。
      

  3.   

    绑定的数据源中没有找到'JudgeTime' 这个字段
      

  4.   

    搜索下用到'JudgeTime' 这个字段的地方去掉或修改
      

  5.   

    GridView1里应该有JudgeTime这样的一个列名。但是在你要绑定的数据源ds里没有这样的数据。
      

  6.   

    我估计在GridView1中,先后绑定多个不同数据源了