How can pass multi query to Master Details c#

95 views Asked by At

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;
}
1

There are 1 answers

0
我零0七 On

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