简体   繁体   English

如何将多查询传递给主详细信息 c#

[英]How can pass multi query to Master Details c#

I have a Master Details data grid, I want to bind my data entity to the master detail's child.我有一个主细节数据网格,我想将我的数据实体绑定到主细节的孩子。 I don't know how to bind an entity to a child?我不知道如何将实体绑定到孩子? Can you help me with that?你能帮我解决这个问题吗?

using (IDbConnection db = new SqlConnection("Data Source =.; Initial Catalog = tejarat_iran; Integrated Security = True"))
{
    var multiReport = db.QueryMultiple("SearchReport", new { search = IdCompany, kind = 0 }, null, null, CommandType.StoredProcedure);
    var company = multiReport.Read<Class_entity.companyentity>().AsList();
    var person = multiReport.Read<Class_entity.personEntity>().AsList();
    var product = multiReport.Read<Class_entity.productentity>().AsList();
    tblsherkatBindingSource.DataSource = company;
}

To use Master-Detail grid,The first thing is read official tutorial.要使用主从网格,首先是阅读官方教程。

So, for the Working with Master-Detail Relationships in Code ,you can know how to Load Details Dynamically by Handling Events所以,对于在代码中处理主从关系,你可以知道如何通过处理事件来动态加载细节

There are some useful demos in Examples: Master-Detail Mode 示例中有一些有用的演示:主从模式

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM