I have two tables in my database. One table holds payments and the other holds charges. I have a view that unions the two tables together. When i run a query in Enterprise Manager for a specific she has a total of 292 rows. When i try to retrieve the records for her using Linq only 26 records are returned. Its like the query stops returning records before the union is finishing joining all the rows. Any suggestions? BTW this is DevForce 2010. I cannot use .net 4.5 as i have too many clients still using XP at this point. Here is my query public void GetMemberTransactionsAsync(string socSecNo, Action<IEnumerable<MemberTransaction>> onSuccess,
Action<Exception> onFail)
{
var query = Manager.MemberTransactions
.Where(m => m.socsecno == socSecNo)
.OrderBy(m => m.TranDate)
.ExecuteAsync(
op =>
{
if (op.CompletedSuccessfully)
{
if (onSuccess != null)
onSuccess(op.Results);
}
else
{
if (onFail != null)
{
op.MarkErrorAsHandled();
onFail(op.Error);
}
}
}
);
} Here is my union and view SELECT socsecno, datedeb AS trandate, round(duesamount, 2) AS tranamount, 'D' AS trancode, isnull(duescatdesc, '***') AS trantype, 0 AS receipt, '' AS paidthru, isnull(note, ' ') AS remark, duesowed.duescatcd FROM duesowed LEFT JOIN duescateg ON duesowed.duescatcd = duescateg.duescatcd UNION ALL SELECT socsecno, batchdate AS trandate, round((duesamount * - 1), 2) AS tranamount, 'P' AS trancode, isnull(paytypedesc, '***') AS trantype, receiptno AS receipt, paidthru, isnull(checkno, ' ') AS remark, duescatcd FROM memdues LEFT JOIN paytypes ON memdues.paytype = paytypes.paytype Am I going to have to read both tables and merge them myself in code or can this be fixed?
|