Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8465305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:00:26+00:00 2026-06-10T15:00:26+00:00

I have a data table containing multiple columns and one column that stores somewhat

  • 0

I have a data table containing multiple columns and one column that stores somewhat complex text patterns – I need to parse the field to determine if a particular sub strings exist in specific positions within the larger string pattern and then if the record should be filtered out as a result.

I can’t see a way to perform the parse other than by writing a C# parsing function with String.Split method calls, foreach, etc. But if I try to parse like this:

var myFilteredTable = _db.MyTable.Where(t => t.Column1 == 'Filter1' 
                                        && ParseIsMyItemInColumn2(t) );

I get “has no supported translation to SQL” errors.

The other option I thought of was to build the initial result without the Parse:

var myFilteredTable = _db.MyTable.Where(t => t.Column1 == 'Filter1' );

and iterate through the IQueryable resultset, testing each row with the parse function, to filter out the unwanted rows, but IQueryable does not have Remove function to strip out unwanted rows nor Add function to allow me to build up a new resultset.

So how can I filter in linq when I also need to write a Parse function?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T15:00:29+00:00Added an answer on June 10, 2026 at 3:00 pm

    Well the “initial filter in the database then do the rest locally” is easy:

    var filtered = _db.MyTable.Where(t => t.Column1 == "Filter1")
                              .AsEnumerable() // Do the rest locally
                              .Where(t => ParseIsMyItemInColumn2(t));
    

    AsEnumerable is a simple pass through method, but because the result is typed as IEnumerable<T> rather than IQueryable<T>, the subsequent LINQ operations use the LINQ to Objects methods in Enumerable rather than the ones in Queryable.

    Obviously if a lot of items match the first filter but fail the second, that won’t be terribly efficient…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have data table containing one column as FilePath. FilePath D:\New folder\link.txt D:\New folder\SharepointMigration(Work
I have a db table containing a column display_order . The data looks like
I have a SQL Server DB containing a registrations table that I need to
I have a table say, ITEM, in MySQL that stores data as follows: ID
I have three tables, table one (tableA) containing users data like name and email,
I have a table containing data and one of the fields is 'class' When
I have a table containing lots of data and one of them is a
I have a non-normal field containing multiple values because it is Xml data that
Ok I have a data table containing duplicate Reciept numbers and a transaction value
I have a table containing data about some users. Many of them use our

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.