score:3
Accepted answer
Your query is enumerating (indirectly) through the rows in the table. As you should already know, you cannot modify a collection (remove something in this case) as you enumerate over it. Throw the contents into a list beforehand. That way you're not enumerating through the actual table but a copy of some rows.
var query = (from row in errorDataSet.Tables[0].AsEnumerable()
where !String.IsNullOrEmpty(row.Field<string>("Message"))
select row).ToList();
Source: stackoverflow.com
Related Query
- How to remove records from a dataset with LINQ
- How can I add and remove records from a collection with LINQ
- How to select multiple columns from dataset into a string list with LinQ
- how to get records from database with multi parameters linq
- How to remove duplicate records from LINQ query
- How to remove common objects from two lists with linq
- Using linq how do i remove multiple records from a cross reference table
- How to properly get records from database with linq in c#
- how to select records from multiple table with max count value from one table using Linq in Asp.net MVC C#
- How to select only those records from collection which have relation with another table using Linq
- How to select only the records with the highest date in LINQ
- How to remove duplicates from collection using IEqualityComparer, LinQ Distinct
- Select single column from dataset with LINQ
- How to remove an element from an xml using Xdocument when we have multiple elements with same name but different attributes
- How can I set properties on all items from a linq query with values from another object that is also pulled from a query?
- How do I remove items from generic list, based on multiple conditions and using linq
- How to remove characters from a string using LINQ
- How to get the latest date inserted from the table with Linq to entities
- How to understand the following C# linq code of implementing the algorithm to return all combinations of k elements from n
- LINQ method How to SelectMany with additional column from Parent class
- How to pass LinQ Expressions from F# to C# code
- Joining two tables with LINQ while also returning null records from the second table
- How do you remove xmlns from elements when generating XML with LINQ?
- How does linq actually execute the code to retrieve data from the data source?
- how to get all columns from a linq result with a join
- how to take 100 records from linq query based on a condition
- How to create a list from filtering 2 lists with linq to object
- how to get values from var-source with linq
- How to include one specific row from another table with LINQ to Entities
- How do you remove trailing objects from a list with linq?
More Query from same tag
- Check for new items in an existing list LINQ/LAMBDA/C#
- Need LINQ expression to filter table based on foreign key values
- Expressions - how to reuse business logic? How to combine them?
- Linq iterate a control collection
- CollectionAssert failed to do exact match - need best approach
- Getting distinct values by two fields
- Convert a Model Class Collection to Dictionary based on property as KEY using LINQ C#
- convert sql queries to linq queries
- selecting entire row in linq after groupby
- Simplifying my Linq query and union
- How to use where in LINQ with json column postgreSQL
- C# ?? null coalescing operator LINQ
- Find MAX/MIN list item using LINQ?
- How to update a document in documentdb using linq
- Forming SQL/LINQ query - Ordered elements across different rows sharing logical grouping
- dynamic sort columns doesn't work in linq
- Linq many-to-many, GroupJoin or SelectMany
- C# CSV dynamic split
- How do I group/aggregate but return fields other than the aggregation field?
- LINQ to Entities and many to many
- Linq join query displayed in MVC view
- C# List ConvertAll with Index
- Spacing out output with Linq to Xml
- More than one record is updated EF-Linq C#
- How to speed up this Linq query
- Trouble binding XML child to DataList using ReadXML()
- comparing the date to the current date and displaying the appropriate date in cakephp
- Value cannot be null. Error
- LinqToDb: Rank is server-side method
- Convert A Union Query To LINQ To Entity Query