0

I have the following code attempting to complete a query to fill a datalist. I need to join them but I can't find entity spaces documentation that follows the syntax style I am using, I am attempting to change/rewrite as little of this code as possible. Please help me complete the query.

Let us say that table estimtes contacts field id which contractors also contains and I want to join on it, this is what I have so far:

Estimates resest = new Estimates();


        Contractors cons = new Contractors();

        cons.Query.LoadDataTable();


        DataList dl = (DataList)pn90day.FindControl("dlpreapprovalestimates");



        resest.Query.Where(resest.Query.FDDKey.Equal(FDDkey));
        resest.Query.InnerJoin(

2 Answers2

2
EstimatesQuery eq = new EstimatesQuery("es");
ContractorsQuery cq = new ContractorsQuery("co");

eq.Where(eq.FDDKey == FDDkey);
eq.InnerJoin(cq).On(eq.Contractorky == cq.Contractorky);

EstimatesCollection coll = new EstimatesCollection();
if(coll.Load(eq))
{
    // Then we have found at least one
}

I am the author of EntitySpaces

  • Hi, is it possible anyway to imclude more than one join clauses during inner joins? I badly need this in my project. Thanks. – Shahnawaz Mar 21 '16 at 07:25
0

Estimates resest = new Estimates();

        Contractors cons = new Contractors();

        EstimatesQuery est = new EstimatesQuery("es");
        ContractorsQuery cont = new ContractorsQuery("co");

        //cons.Query.LoadDataTable();


        DataList dl = (DataList)pn90day.FindControl("dlpreapprovalestimates");


        est.Where(est.FDDKey.Equal(FDDkey));

        est.InnerJoin(cont).On(est.Contractorky == cont.Contractorky);