是不是执行了正确的程序? [英] Correct Procedure is not executed ?
问题描述
public void GettraderwiseLiftingRecords()
{
DataTable dtLEtraderReport = new DataTable();
dtLEtraderReport.Clear();
dtLEtraderReport = objhatcheryBAL.GetchicksaledueReport();
GVTraderdueReport.DataSource = dtLEtraderReport;
GVTraderdueReport.DataBind();
}
我在页面加载中调用了GettraderwiseLiftingRecords()方法。如果我调试它直接使用此方法..当GetchicksaledueReport()方法被执行,然后它需要主页面登录详细信息程序...这里dtLEtraderReport获取登录详细信息..为什么它采取了另一个细节..
最后我得到一个例外,如DataBinding:'System.Data.DataRowView'不包含名称'name'的属性....
I called GettraderwiseLiftingRecords() method in page load..if i debug it goes directly this method..when GetchicksaledueReport() method is executed ,then it takes Master page Login Details procedure...here "dtLEtraderReport" get Login details..why it's taken another details..
Finally i am getting an exception like "DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'name'"....
推荐答案
你提到一个简单的方法和正确的错误,当列不匹配时会出现这种类型的错误,下面提到一个例子
假设我们可以在数据列表中声明如此
A simple way and correct error you are mention, this type of error will be come when column does not match like that, one example are mention below
suppose we can declared in data list like that
<![CDATA[<%#Bind('userName')%>]]>
但是当我们是ge时来自dataBase的数据不包含'userName',那么我们的程序将如何成功。
再次检查表列名和前端声明的名称。
i希望在阅读完之后清除你的问题。
快乐编码
jsb
but when we are get the data from the dataBase does not contains 'userName' then how can our program will success.
check again table column name and front end declared name.
i hope clear your problem after reading this.
happy coding
jsb
DataBinding:'System .Data.DataRowView'不包含名称为'name'的属性....
"DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'name'"....
这意味着您正在尝试读取一些列或属性来自 DataSource
,其中不存在。
因此,请检查您的Markup以检查您是否有任何列与数据库中返回的列不匹配,存在于 DataSource
。
This means you are trying to read some Column or Property from DataSource
which is not present in that.
So, review your Markup to check if you have any Column not matching with the returned Columns from Database, present in DataSource
.
这篇关于是不是执行了正确的程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!