LINQ to DataSet: With multiple group and multiple aggregating RRS feed

  • Question

  • Hi,

    Can any one please answer the exact LINQ to Dataset query for the below SQl query (i.e, With multiple group and multiple aggregating):


    SELECT pe, orderpe, branch, count(qty), avg(overall), avg(resp), avg(relia), avg(assur), avg(emp)

    FROM [table]

    GROUP BY pe, orderpe, branch;



    Tuesday, March 15, 2011 12:16 PM


  • Hi lln14;

    Linq does not support loading data directly from SQL server to a data table. In order to do this you will need to create a DataTable and then fill the DataTable one row at a time. Here is a solution found on the Net, http://blogs.msdn.com/b/aconrad/archive/2007/09/07/science-project.aspx.

    In ordee to covert the T-SQL query in your question I need to know what programming language you are using.


    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".
    • Marked as answer by Jackie-Sun Wednesday, March 23, 2011 2:47 AM
    Tuesday, March 15, 2011 2:27 PM