I have an AspTable with a small number of rows. I want to run a linq Where() on the collection to find one and remove it.
mytable.Rows is of type TableRowCollection mytable.Rows.AsQueryable() says it returns a Linq.Queryable but intellisense on this does not give me my Linq operators.
You should be able to use:
myTable.Rows.Cast<TableRow>()
The problem is that TableRowCollection
implements IEnumerable
, but not IEnumerable<T>
- and it's the latter that LINQ to Objects works with, primarily. The above will create an IEnumerable<TableRow>
which will basically cast each item in turn.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With