I have this code,
Data Summary is a class, it is not an entity. I use it for the anonymous type on "select new"
public class DataSummary
{
public DataSummary()
{
}
public int AccountID
{
get; set;
}
public decimal Total
{
get; set;
}
}
then I have this query
DateTime date1 = new DateTime(2003, 1, 1);
DateTime date2 = new DateTime(2011, 1, 1);
InitializeComponent();
var query = (from d in svc.Data
where d.Date >= date1 && d.Date <= date2
group d by d.AccountID into g
orderby g.Key
select new DataSummary()
{
AccountID = g.Key.Value,
Total = g.Sum(d => (decimal) d.Value)
}) as DataServiceQuery<DataSummary>;
query.BeginExecute(new AsyncCallback(r =>
{
try
{
this.grid.ItemsSource = query.EndExecute(r).ToList();
}
catch (Exception ex)
{
string message = ex.Message;
}
}), null);
when I run the query, It says that group by it is not supported. I have seen many question about WCF data services that use group by. anybody know what is going on???
When I put the code in the server side, it gives me an error too. I have tried to retrieve information with datasummary without the group by and it works. so I am out of options
Thanks in advance