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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:38:04+00:00 2026-06-02T19:38:04+00:00

I have a table set up like so: prefix | value ABC 1234 ABC

  • 0

I have a table set up like so:

prefix | value
 ABC     1234
 ABC     5678
 DEF     1234

Is it possible to create a linq query where prefix and value are concatenated for comparison in the where clause? I’ve tried this, but it always returns an empty set:

selected =
            from i in dc.items
            where i.prefix + i.value == "ABC1234"
            select i;

Edit: the following T-SQL comes up with the correct results:

 WHERE LTRIM(RTRIM([prefix])) + LTRIM(RTRIM([value])) = 'ABC1234'

Edit2: The following, which combines most of the answers below, still does not work:

where (String.Concat(i.prefix.Trim(), i.value.Trim())) == "ABC1234"

Edit3: So I’ve got it working, but I have no clue why. I’ve accepted an answer but if someone posts why it works I’d be grateful 🙂

This works (returns n rows):

var temp = dc.items.Where(i => i.prefix.Trim() + i.prefix.Trim() == "ABC1234");

This does not work (returns 0 rows):

var temp =
            from i in dc.items
            where i.prefix.Trim() + i.value.Trim() == "ABC1234"
            select i;
  • 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-02T19:38:10+00:00Added an answer on June 2, 2026 at 7:38 pm

    I dont’s speak english. Try this:

    var selected = dc.Where(x => x.prefix + x.value == "ABC1234");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SQL table set that looks like this create table foo (
I have a table and I would like to be able to set up
I need to have MySQL query like this one: UPDATE table_name SET 1 =
I have my table columns set like this: likes(id, like_message, timestamp) id is the
i have a mysql table set up like so: id uid keywords -- ---
I have a temp table set up like this: Type Rate TotalCost ---- ----
I have a table set up like this Project Category Date Hours Proj1 test
I have a table set out like: <table id=myTable> <thead> <tr> <td><input type=checkbox id=selectall
I have a mysql table set up like this id | refference_id | data
I have 2 tables set up like this (irrelevant rows omitted): > product -

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.