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 8304225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:47:19+00:00 2026-06-08T17:47:19+00:00

string1: How string2: How Are you ? What i want to do is select

  • 0

string1: How
string2: How Are you ?

What i want to do is select all records from the database by checking string2 against string1 and selecting any record which have either “How” or “Are” or “you”.

 pager1.ItemCount = appliedQuery.Where(q => q.string1.Contains(string2)).count();

PlEASE NOTE: String1 is just one word and I just want to get all records in the db with any occurance of any word in string2.

I understand that string2 needs to split, however after the split how do i use it in the linq query statement to fetch the records?

Thanks in advance

  • 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-08T17:47:20+00:00Added an answer on June 8, 2026 at 5:47 pm

    Check out how I constructed my linq query. I hope this helps.
    Just try to copy and paste the code in your console app to see the result.

    class Program
    {
        static void Main(string[] args)
        {
            // List of strings that you may consider it from your 
            /// database which is String1
            List<string> lstStrings = new List<string>();
            lstStrings.Add("twenty one");
            lstStrings.Add("twenty two");
            lstStrings.Add("twenty three");
            lstStrings.Add("twenty four");
    
            // The string to compare to which is your String2
            string strString = "one two four";
    
            // Splitting the strings to be compared
            string[] strArray = strString.Split(' '); 
    
            // The linq that helps you query the data exactly as what you wanted
            var result = (from string A in lstStrings
                                   from string B in strArray
                                   where A.Contains(B)
                                   select A).Distinct();
    
            // Count result
            Console.WriteLine(result.Count());
    
            // Individual values
            foreach (string str in result)
            {
                Console.WriteLine(str);
            }
    
            Console.ReadLine();
        } 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can i read only one record, when i want all records its fine
I have this string: Test: String And I want to select the text before
I want to SELECT a formatted date string from a datetime type in SQL
i want to format date to string in hql select, for example i have
I have an element: <select id=row /> I want to append a string to
I have a Dataset that contains tables from a university database, two(actually more) of
I have a table with about 1000 records and 2000 columns. What I want
I have a task of copying the data from one database to another.I don't
Hi all I want to crate the simple app in which user inputs the
Normally, when querying a database with SELECT, its common to want to find the

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.