- Joined
- 27 Jan 2005
- Posts
- 1,373
- Location
- S. Yorks
LINQ just doesn't seem to be able to do this, can't understand why, have now created the code in FETCHXML and going to give that a go.
regards,
Matt
regards,
Matt
LINQ just doesn't seem to be able to do this, can't understand why, have now created the code in FETCHXML and going to give that a go.
regards,
Matt
var retrievedProducts = (from p in orgcontext.ProductSet
join qd in orgcontext.QuoteDetailSet
on p.ProductId equals qd.sp_SellingProductId.Id
where qd.QuoteId.Id == entity.Id
select new
{
product_name = p.orb_ParentProductid
}).Distinct();
var _txttowrite = string.Empty;
if (retrievedProducts != null)
{
// for each item returned write the output to a string.
foreach (var item in retrievedProducts)
{
if (item.product_name != null)
{
if (String.IsNullOrEmpty(_txttowrite))
{
_txttowrite = item.product_name.Name;
}
else
{
_txttowrite += ", " + item.product_name.Name;
}
}
}
}