高手们快来帮帮我!!!

mengxian922 mengxian922 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

list Count = 3 System.Collections.Generic.IList<SSO.BLL.B_RegisterInfo> {System.Collections.Generic.List<SSO.BLL.B_RegisterInfo>}
- [0] {SSO.BLL.B_RegisterInfo} SSO.BLL.B_RegisterInfo
+ m_AuditTime {2012-2-8 15:15:33} System.DateTime
m_BranchAddress "222" string
m_BranchCode null string
m_BranchName "222" string
m_DepName "222" string
m_EMail null string
m_EmpID 11 int
m_EmpName "222" string
m_LoginID "222" string
m_Mobile "13260162101" string
m_PassWord "222" string
+ m_RegisterTime {2012-2-8 15:15:33} System.DateTime
m_Role "222" string
m_State 1 int
m_TelNum "22222222" string
m_UserType 1 int
+ [1] {SSO.BLL.B_RegisterInfo} SSO.BLL.B_RegisterInfo
+ [2] {SSO.BLL.B_RegisterInfo} SSO.BLL.B_RegisterInfo
+ 原始视图
+ register {SSO.BLL.B_RegisterInfo} SSO.BLL.B_RegisterInfo
+ this {ASP.user_webform1_aspx} Passports.user.WebForm1 {ASP.user_webform1_aspx}



这是调试看到返回来的数据,我想把这3条数据(上面只显示一条)绑定到GridView上,可是总是报在选定的数据源上未找到名为“xxxx”的字段或属性。
把名字换成数据库中的字段也不行。
下面是我自己绑定的写法
        <asp:GridView ID="gvEnterprise" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="m_EmpID" HeaderText="序号" />
<asp:BoundField DataField="BranchName" HeaderText="公司名称" />
<asp:BoundField DataField="BranchAddress" HeaderText="公司地址" />
<asp:BoundField DataField="EmpName" HeaderText="注册人" />
<asp:BoundField DataField="TelNum" HeaderText="联系电话" />
<asp:BoundField DataField="EMail" HeaderText="电子邮件" />
<asp:CommandField />
</Columns>
</asp:GridView>


代码段这么写的
    public partial class WebForm1 : System.Web.UI.Page
{
B_RegisterInfo register = new B_RegisterInfo();//B_RegisterInfo为我BLL层的类
protected void Page_Load(object sender, EventArgs e)
{
IList<B_RegisterInfo> list = register.GetB_RegisterInfoBySqlWhere("State='1'"); //获取State=1的数据
gvEnterprise.DataSource =list;
gvEnterprise.DataBind();
}
...全文
评论 9
收藏 已收藏
分享
返回顶部
mengxian922
.NET社区 62,274 成员 668,968 内容