Мне нужно сделать группировку по order.OrderID
var query = from order in mydb.Orders
join customer in mydb.Customers on order.CustomerID equals customer.CustomerID
join employee in mydb.Employees on order.EmployeeID equals employee.EmployeeID
join shipper in mydb.Shippers on order.ShipVia equals shipper.ShipperID
join orderdetail in mydb.Order_Details on order.OrderID equals orderdetail.OrderID
join product in mydb.Products on orderdetail.ProductID equals product.ProductID
select new
{
OrderID = order.OrderID,
CustomerName = customer.CompanyName,
EmployeeName = employee.FirstName,
ShipperName = shipper.CompanyName,
Products = product.ProductName,
TotalPrice = orderdetail.UnitPrice * orderdetail.Quantity
} into d
group d by d.OrderID;
Затем я хочу вывести данные сюда
<asp:LinqDataSource
ContextTypeName="NorthDataContext"
TableName="Contacts"
Where="EmailPromotion=1"
ID="Linq"
runat="server">
</asp:LinqDataSource>
<asp:GridView ID="Grid" runat="server">
</asp:GridView>
Вывожу таким образом
Grid.DataSource = query;
Grid.DataBind();