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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:09:11+00:00 2026-06-05T23:09:11+00:00

Afternoon, I am trying to make a simple search, which is working for the

  • 0

Afternoon, I am trying to make a simple search, which is working for the product title. However i need to add other parameters in for the search. I have the basis of the code below, at least what i think it should be. I have commented out the other items

Could someone please provide some guidance on this as i am stuck on it atm.

var query = from a in dc.aProducts
            join t in dc.bProducts on a.sku equals t.sku
            where SqlMethods.Like(t.title, "%" + productName + "%")

            //Compare Prices
            //&& (p => (double)p.Price >= priceFrom && (double)p.Price <= priceTo)
            //Product SKU
            //t.sku == productSku
            //Product Brand
            //t.brand == productBrand
            //a.asin == productAsin
            //a.Live == IsLive

Many thanks in advance, all help is much appreciated.

  • 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-05T23:09:14+00:00Added an answer on June 5, 2026 at 11:09 pm

    I’d be tempted to do something like this:

    bool comparePrices = true;
    
    // Join tables and get all products into query
    var query = from a in dc.aProducts
                join t in dc.bProducts on a.sku equals t.sku
                select a;
    
    // Now go through each search criteria if needed in order to filter down
    if(comparePrices)
        query = query.Where(p => (double)p.Price >= priceFrom 
                              && (double)p.Price <= priceTo);
    
    if(!string.IsNullOrEmpty(productSku))
    {
        query = query.Where(t.sku == productSku);
    }
    

    Etc.

    Each time you are conditionally adding filters to your original query.

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

Sidebar

Related Questions

Afternoon, I am trying have an HTML file containing a frameset which contains two
I have been struggling all afternoon trying to get a simple mailto: tag to
I have spent the afternoon trying to wrap my mind around how to translate
I have been trying all afternoon to get the jQuery Sifr Plugin ( http://jquery.thewikies.com/sifr/
Good Afternoon, I am trying to assign some variables to a listing which has
I have been trying all afternoon to try and achieve this with no success.
Good Afternoon, I'm currently trying to build something incredibly simple inside of the Google
Good Morning/Afternoon all, I have a ASP:grid which displays current versions of Terms and
I'm at the moment trying to make a very simple app that will greet
I'm trying to make a form which takes in a users name, and then

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.