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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T21:35:15+00:00 2026-06-16T21:35:15+00:00

I’have been working around on how to properly implement the bellow task in a

  • 0

I’have been working around on how to properly implement the bellow task in a c# project.

It is pretendended to …

Get all data that exists in a particular database’s table(db1) but that does NOT EXISTS on another particular database’s table (db2)

both tables have common ids

I’ve faced lots of posts about this but it seems none solves my problem.
Any help?

EDITED:

Select all data 
on table_x from database_x 
Where item_id from table_x are not found inside table_y from database_y

=> return data in list format

  • 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-16T21:35:16+00:00Added an answer on June 16, 2026 at 9:35 pm

    This were the solution that I was looking for. Based on @user1949706’s answer I selected all data from both tables with LINQ (also from different databases) and I placed it on memory.

    To fully answer my question on how to do this with LINQ here it is:

    //DB1
    db1DataContext db1 = new db1DataContext();
    //DB2
    db2DataContext db2 = new db2DataContext();
    
    
    //SELECT ALL DATA FROM DB1
    var result1 = (from e in db1.Items
                   select e
                  ).ToList();
    
    //SELECT ALL DATA FROM DB2
    var result2 = (from e in db2.Item2s
                   select e
                  ).ToList();
    
    //SELECT ALL ELEMENTS FROM DB2.TABLE THAT DO NOT EXISTS ON DB1.TABLE BASED ON EXISTING ID's            
    var resultFinal = ( from e in result1
                        where !(from m in result2
                                select m.Id).Contains(e.Id)
                        select e
                      ).ToList();
    

    I would also thank Robert Rouse on his anwser to this question and everybody else who tried to help.

    Hope it helps someone else!

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a jquery bug and I've been looking for hours now, I can't
I have a small JavaScript validation script that validates inputs based on Regex. I
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I have been unable to fix a problem with Java Unicode and encoding. The
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
Let's say I'm outputting a post title and in our database, it's Hello Y’all

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.