score:2
Accepted answer
you can use copytodatatable:
datatable dt = query.copytotable()
score:0
take a look at this, http://msdn.microsoft.com/en-us/library/bb386921.aspx hope that is what you are looking for?
score:3
var query = dtreports.asenumerable()
.orderby(x => x.field<string>("reportnumber").substring(0, 4))
.thenby(x => x.field<string>("reportnumber").substring(5));
var dt = query.copytodatatable<datarow>();
Source: stackoverflow.com
Related Query
- Ordering a DataTable with Linq to DataSet using field substrings
- DataTable: Get Max Value Using LINQ With Criteria Field (GroupBy)
- SELECT NEW with a potentially null field using LINQ and Entity Framework
- How to sort datatable with multi column using LINQ
- get distinct rows from datatable using Linq (distinct with mulitiple columns)
- Search datatable using Linq to dataset
- Trying to get distinct values using LINQ with database field as parameter
- Dynamically build up a linq query with hierarchy using string field names?
- Populate a C# class from a dataset with multiple linked tables using linq lambda
- I need to compare list with Datatable and filter values using Linq
- Linq sub query when using a repository pattern with EF code first
- Using LINQ to flatten a hierarchical dataset - with a caveat
- Using LINQ to return just two specific DataTables in a DataSet with several DataTables
- Can't add a new record with an integer value into database by using linq from code C#
- How to create a new DateTime where condition using table field with LINQ
- How to sum values for multiple columns in DataTable using Groupby with Linq
- Compiling Error with LINQ Sorting Code Using List<T>
- How to get datarow array refering to datatable 's field value with linq
- Querying DataSet with LIKE and OR using LINQ with C#
- Help with querying a DataTable using LINQ
- I need to save the XML file using linq with xml code in C#
- C# Using Linq Query with where clause as variable on dataTable
- EF code first: using Linq with many-to-many relationship
- Linq Query Using DataTable with Paging
- Ordering Datatable using Linq Or without creating copy of DataTable
- Select top N with record from DataTable with some sorting using Linq
- Ordering by ICollection property using its name as string with Dynamic Linq Library
- using linq on datatable and putting result back into datatable with same format
- Making a new DataTable out of two others with same ID using LINQ in C#
- Compare 2 dataTable which are linked with primary Key in c# using Linq
More Query from same tag
- LINQ 'in' clause for child object properties
- Why would one define a local function in C# just to call it right away (in context of IEnumerable<T>)
- how to translate linq query to method calls
- Wrong results for suming right side of List
- linq get all object in one-dimensional collection
- IEnumerable: Get all before the last that matches a predicate
- conditions in linq query
- Sum in Linq to Sql not returning a value
- LINQ Expression - Returning a UserID based on the Name Specified in a LinkLabel
- linq2sql and multiple joins
- Is my usage of LINQ to XML correct when I'm trying to find multiple values in the same XML file?
- Select Id(s) using Linq
- Get value in foreach-loop
- Linq query update all items in groups that meet my condition
- Get list from enum
- Left outer join in Linq
- Lambda to turn IDictionary<string,object> values into object[]
- Linq filter part of the date
- Understand xml namespaces used with linq
- How to TypeCast SelectMany Results
- From Dictionary select only specified keys using Linq
- How do I use LINQ to combine these two methods?
- Alternative to Contains method in Generics
- RowNumber using Linq
- Linq query using result of another query
- How to create the function using Expression linq
- Create LINQ in table that has many2many relation
- Merging sequences by type With LINQ
- Linq Query Dictionary where value in List
- Attempted to divide by zero Linq