Click here to Skip to main content
15,884,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
//I have the following methods. I want to query a table data by using the output i got from previous query. I tried the below code but data does not load.

C#
private void btnFetch_Click(object sender, RoutedEventArgs e)
        {
            ctx = new Context();
//Data loads here
            ctx.Load(ctx.GetQuery()).Completed += new EventHandler(Report_Completed);
        }

        void Report_Completed(object sender, EventArgs e)
        {
int foundryId=1;
//Data loads here
            ctx.Load(ctx.GetReportQuery(foundryId, (DateTime)fromDatePicker.SelectedDate,
                (DateTime)toDatePicker.SelectedDate)).Completed += loadCompleted;
        }


C#
private void loadCompleted(object sender, EventArgs e)
        {
C#
if (ctx.IsLoading) return;
           var report = ((LoadOperation<FilmConsumptionReportRow>)sender).Entities;

C#
foreach (var r in report)
            {

C#
//I am trying to load the data here. But data is null.
ctxForPreviousREport = new RadiographyContext();                   ctxForPreviousREport.Load(ctxForPreviousREport.GetRGReportsOnRtNoAndReshootNoQuery(r.RTNo, r.ReshootNo));
                    RGReport rGReport = ctxForPreviousREport.RGReports.FirstOrDefault();
}
}


I need some help!
Thank you
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900