Linq Table Where clause as string RRS feed

  • Question

  • I want to know if it is possible to use a string as the where clause in a LINQ select.  I have a bunch of tests that are stored as string expressions and I want to be able to test them against various tables in a dataset.

    What I want to be able to do is something like this:

    ' ds is a dataset  
    Dim sSel as string = "Table.LastName <> '' and Table.SSN <> '' AND (Table.St = 'IL' AND Left(Table.Zip,2) = '60')" 
    Dim rows = From dtedi In ds.AsEnumerable.Where(search) 
    Friday, December 12, 2008 8:59 PM

All replies