score:2
Accepted answer
create the first filter in a separate ienumerable, then use it to create both dataviews:
var filtered = dt.asenumerable()
.where(r => r.field<int>("id") < 1000);
dataview dv1 = filtered.asdataview();
dataview dv2 = filtered.where(r => r.field<string>("salary") > 50000)
.asdataview();
Source: stackoverflow.com
Related Query
- creating Linq to sqlite dbml from DbLinq source code
- C# create DataView from DataView
- c# Linq or code to extract groups from a single list of source data
- Create a list from two object lists with linq
- Favorite way to create an new IEnumerable<T> sequence from a single value?
- How do I dynamically create an Expression<Func<MyClass, bool>> predicate from Expression<Func<MyClass, string>>?
- Create a list of one object type from a list of another using Linq
- How to create a csv file from List<String[]>
- Create combined DataTable from two DataTables joined with LINQ. C#
- Create a list from another list
- How to create LINQ Query from string?
- Create Items from 3 collections using Linq
- Enumerable.Empty<T>().AsQueryable(); This method supports the LINQ to Entities infrastructure and is not intended to be used directly from your code
- Accessing Results View from variable in code
- How to create a dynamic LINQ select projection function from a string[] of names?
- Generating the Shortest Regex Dynamically from a source List of Strings
- How Do I Create an Expression<Func<>> with Type Parameters from a Type Variable
- How to understand the following C# linq code of implementing the algorithm to return all combinations of k elements from n
- Is it possible to create one dimension array from two using LINQ?
- How to create hierarchy in json string from string array?
- How to create a complex type from a stored procedure that uses exec()?
- What is the best way to create strongly typed LINQ queries from some given strings, via reflection
- Is there any way to create a LINQ query as a variable without having the data source (yet)?
- Create an XML from a DataTable
- How to pass LinQ Expressions from F# to C# code
- Create and initialize dictionary from list
- LINQ: Can we create a flat list from hierarchy
- LINQ query to create a collection of objects combined from a collection of strings
- Using LINQ to delete an element from a ObservableCollection Source
- Create a nested list of items from objects with a parent reference
More Query from same tag
- Force Entity Framework to update several records in one round trip.
- Creating JSON object from Ienumerable using LINQ
- Assigning rows evenly from table
- LINQ: Efficient way to get sum of all child items
- Compare two list elements with LINQ
- LINQ Query to compare two values of an object to a list, where both objects must match
- Getting distinct not null dates from datetime collection
- Many to Many and Linq: updating relationships
- Linq dynamic expression for filtering navigation properties and collections
- Initializing an IEnumerable of ViewModels from an IEnumerable of Models
- linq aggregated nested count
- Cascading Drop Down Lists with Lambda Expression in LINQ
- Most performant way to filter a huge List in C#?
- How to get distinct with highest value using Linq
- Count how many columns 'is not null' for each row and put that information into another column
- Where clause that is passed as parameter to a method not working
- GroupBy with multiple groups level
- Add a list to a list Linq C#
- How to regenerate grid data on various button click event of a page while we are using telerik grid with LinqDataSource
- Is there a better way to return the next item in a list and loop from the end to the front?
- How to remove NULL columns from a LINQ query for ObjectDataSource
- use LINQ to XML to Programmatically get all differences between 2 xml files
- How can I turn a lambda expression specifying a property into an asp.net mvc compatible 'name' string representing the same?
- How can I find the entries with dates older then a specified date in a list but all data types are string?
- Is there another way to take N at a time than a for loop?
- How to get the inner text from an xml document using XDocument and extension methods
- Casting derived class to base class using LINQ to Entities
- LINQ to SQL - select where text like string array
- How can I return variable column lengths via LINQ to SQL
- Linq xml recursive select