the detail table is not loaded and is not part of the query. This query brings in tens of thousands of rows and I only have a small network pipe to send it, so I can't afford bringing all the header data for each of the detail datapoints. I also have to save the data as the users want to access this offline, so I can't use deferred loading either.
using Devart 5.70.140.0
Thank you
Code: Select all
//load notes from the database at the same time we load the other data.
mgr.DataContext.DeferredLoadingEnabled = false;
DataLoadOptions dlo = new DataLoadOptions();
dlo.LoadWith(c => c.CommitmentViews);
dlo.LoadWith(c => c.DmdbNotes);
mgr.DataContext.LoadOptions = dlo;
//get datapoints - detail data
var fd = from c in mgr.DataContext.CommitmentViews.LoadWith(cv => cv.DmdbNotes)
where l.Contains(c.SalesRepId) //u.UserId)
orderby
c.CustomerName, c.CustomerNum,
c.Sku,
c.WeekStartDate
select new { c.Data, c.WeekStartDate, c.TimeId, c.DmdbNotes, c.GeographyId, c.CustomerNum, c.Sku };