我的数据源有2条记录,但只出现在XtraReport 1中。为什么?

时间:2013-10-02 15:36:29

标签: c# entity-framework devexpress xtrareport

我正在使用DevExpress XtraReport,我的查询返回两条记录,但只出现在详细信息1中。有人可以告诉我原因吗? 下面是负责加载DataSource的方法的代码。

韩国社交协会!

using (xEntities con = new xEntities())
{
    var result = from m in con.Table1
            join u in con.Table1 on m.Table2Id equals u.Table1Id
            where u.Description.Equals("xxxx")
            select new { m.Name, u.Description };

    DataSource = result.ToList();

    labelDescription.DataBindings.Add("Text", DataSource, "Description");
    labelName.DataBindings.Add("Text", DataSource, "Name");
}

1 个答案:

答案 0 :(得分:0)

您的LINQ查询语法错误或只有您实体的某个描述符合where的要求  子句。

尝试以下方法:

var result = from t1 in con.Table1
             join t2 in con.Table2 on t1.ID equals t2.ID
             where t1.Description.Equals("someDescription")
             select new { ... };
相关问题