c# - Problem with grid when trying to use groupby in LINQ -
When you try to use GROUPBY, I get an error that states that the field 'date1' is selected Not found on the resource.
var query = (Select from db.bt to db.Facts where a.Count_Key == b.Date_key new {a.Date1, a.Month, b.Fact_key} ); Var query2 = query.GroupBy (x => x.Month); Grid1.DataSource = query2; Grid1.DataBind (); Therefore, when I try to bind the query it works perfectly, but the query generates 2 errors
field date1 Not found on the selected data source.
How can I fix this?
The group names different from the original selection by return column.
You can do the following to see it for "educational purpose".
Create a new grid 2 and use it with automatic columnmapping. Divide question 2 into this grid 2 and you will see the result.
Comments
Post a Comment