Last post Feb 12, 2014 02:12 PM by peterthegreat
Feb 08, 2014 03:01 PM|peterthegreat|LINK
From p In product.Values
= Group _
i have the following query statement and want to retrieve the ContactID parameter value inaddition to the Email and Price parameters ?
return the distinct Email and ContactID values together with the total price for each distinct parameter
Feb 12, 2014 03:28 AM|Sam - MSFT|LINK
Try the code below. Though I don't know the complete structure of the table you can refer to the following code and modify as per your need.
var pr = from p in db.ProductTable
group p by p.ContactID into datagroup
contactID = datagroup.Key,
email = datagroup.FirstOrDefault().Email,
price = datagroup.Sum()
Hope it helps!
Feb 12, 2014 02:12 PM|peterthegreat|LINK
Thanks for the code, but i am using a list collection Product.values for the datasource !
error exception states datagroup is not accesible in this context !