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

  • Home
  • SEARCH
  • 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 8282607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:25:46+00:00 2026-06-08T10:25:46+00:00

I have 2 datatable DataTable1 SNo 1 2 3 4 DataTable2 SNo 1 4

  • 0

I have 2 datatable

DataTable1
SNo
1
2
3
4

DataTable2

SNo
1
4
3

I want the result

DataTableResult

SNo
2

I can do it using for loop.

But I am trying to do it using linq.

var intersection = DataTable1.AsEnumerable().Intersect(DataTable2.AsEnumerable(), DataRowComparer.Default);    

Then I found out Intersect is will give u the rows where both tables have.

I dunno exactly what function to use.

Any ideas?

I have got the answer.

Thanks to the person who deleted the answer.

But that gives me a start.

The answer is

var intersection = DataTable1.AsEnumerable().Except(DataTable2.AsEnumerable(), DataRowComparer.Default);
  • 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-08T10:25:48+00:00Added an answer on June 8, 2026 at 10:25 am

    you can try using exept statement it aliitle hard to be precise since you only show the table as structure but you can try somethink like this

     var qry1 = datatable1.AsEnumerable().Select(a => new { SNo.ToString() });
     var qry2 = datatable2.AsEnumerable().Select(b => new { SNo.ToString() });
     var exceptAB = qry1.Except(qry2);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a DataGrid control binded to DataTable using the following: dataGrid1.ItemsSource = dataTable1.DefaultView;
I have a DataGridView that I'm trying to populate using a For loop: Dim
I have 2 datatable DataTable1 and DataTable2, DataTable1 have the column as A,B,C,D and
I have a datatable where I want to change the color of a cell
I have dataTable in my page. Initially I want it to be hidden, and
I have datatable in vb.net 2008 has 40000 rows. i want to delete 1000
var id = Session[staff_id].ToString() //I have datatable with 5 columns DataTable dt = function_return_Datatable(id);
I have DataTable with two columns Author and Bookname . I want to check
I'm using ICEFaces. I have datatable with multiple columns. One I load the page
i have retrived this datatable from datasource and i want to add a more

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.