在.net后台cs文件中select查询语句前台老说找不到数据源
DataBinding:“System.Data.DataRowView”不包含名为“ui_desc”的属性。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息:
System.Web.HttpException: DataBinding:“System.Data.DataRowView”不包含名为“ui_desc”的属性。
源错误:
行 85: <HeaderStyle ForeColor="black" Width="200" />
行 86: <ItemTemplate>
行 87: <asp:Label ID="Label2" runat="server" Text='<%# Bind("ui_desc") %>' />
行 88: </ItemTemplate>
行 89: </asp:TemplateField>
源文件: e:\web\oa\yjgl\fajx.aspx 行: 87
堆栈跟踪:
[HttpException (0x80004005): DataBinding:“System.Data.DataRowView”不包含名为“ui_desc”的属性。]
System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName) +197
System.Web.UI.DataBinder.Eval(Object container, String[] expressionParts) +79
System.Web.UI.DataBinder.Eval(Object container, String expression) +108
System.Web.UI.TemplateControl.Eval(String expression) +120
ASP.oa_yjgl_fajx_aspx.__DataBinding__control24(Object sender, EventArgs e) in e:\web\oa\yjgl\fajx.aspx:87
System.Web.UI.Control.OnDataBinding(EventArgs e) +99
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +206
System.Web.UI.Control.DataBind() +12
System.Web.UI.Control.DataBindChildren() +216
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +216
System.Web.UI.Control.DataBind() +12
System.Web.UI.Control.DataBindChildren() +216
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +216
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) +2957
System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +59
System.Web.UI.WebControls.GridView.PerformDataBinding(IEnumerable data) +11
System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +111
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +29
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
System.Web.UI.WebControls.GridView.DataBind() +4
hkoa.oa.yjgl.fajx.GridViewBind() in D:\we\we\oa\yjgl\fajx.aspx.cs:67
hkoa.oa.yjgl.fajx.Page_Load(Object Sender, EventArgs E) in D:\we\we\oa\yjgl\fajx.aspx.cs:41
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +33
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061
public void GridViewBind()
{
string str1 = " fsr='" + Request.Cookies["hyyc"].Values["hyid_carol"].ToString() + "' and lx='f' and scbz='0'";
//检索未删除、发送类型的当前用户的邮件
switch (jsfa.SelectedValue)
{