Linked Questions
10 questions linked to/from Best Practice: Convert LINQ Query result to a DataTable without looping
1 vote
2 answers
3k views
Convert resultset in to Datatable [duplicate]
How can I convert the result of a LINQ query where I select some columns of a DataTable to a DataTable again? DataTable dtN = new DataTable(); dtN.Columns.Add("Id"); dtN.Columns.Add("Name"); dtN....
4 votes
3 answers
3k views
IEnumerable.Except wont work, so what do I do?
I have a linq to sql database. Very simplified we have 3 tables, Projects and Users. There is a joining table called User_Projects which joins them together. I already have a working method of ...
0 votes
3 answers
2k views
Using JSON and REST web service that outputs the contents of a database
I have created a web service using JSON and REST. What I want to know is how to output contents of a local database using the service? I am using Visual Studio 2015, ASP.NET Web Forms and LINQ ...
3 votes
2 answers
2k views
LINQ query copytodatatable
I have a linq query which is calculating particular data. Now I want that query to be typecasted to DataTable. Here is the query : var query = dt.AsEnumerable() .GroupBy(row => new { ...
1 vote
2 answers
5k views
Convert LINQ to DataTable
The linq query is returning result in form of {DataRow Job1, DataRow Run}. How can i convert JoinResult into a DataTable . var JoinResult = (from Job1 in Jobdata.AsEnumerable() join ...
0 votes
2 answers
898 views
C# Datatable. Compare data from a column and if it matches, append the data from another column of the corresponding row
For Example, If I have the following datatable, Location First name Pincode Manager Sydney John 123 Brian New York Larry 456 Sherry Chicago Meg 789 Linda Dallas Mark 012 Cooper Sydney Jack 123 Brian ...
0 votes
3 answers
1k views
Put LINQ query result to DataTable
I have this query: var smallExchangeReport = from ex in exchangeProgReport where !string.IsNullOrEmpty(ex.comment) group ...
1 vote
0 answers
137 views
how to pass linq query in datatable
I want to collect all rows and pass it to datatable. My linq query: var queryAll = from all in db.tblMake select all ; DataTable dt = new DataTable(); How can i pass the queryAll into datatable dt? ...
0 votes
0 answers
65 views
How to get the result of a linq back to a DataTable?
I have problem when copy query linq to same datatable. DataTable dt_result = filterkontrak.CopyToDataTable(); var query = from q in dt_result.AsEnumerable() select ...
0 votes
1 answer
40 views
Linq grouping and seting datatables
enter image description hereI have this code for grouping and suming column: var groupedData = from b in showit.AsEnumerable() group b by b.Field<string>("Key") into g ...