Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Comparing two tables with similar structure using two datasets in C#.NET

Posted on 2006-12-02
2
983 Views
Last Modified: 2012-06-27
Dear all,
Iam developing an application where iam using Sql Server 2000 as the database. Iam using c#.net for programming my application. Actually we need to compare two tables with similar structure, to do this iam pulling the data from the database in two different datasets. Now my query is how can we compare these two datasets having tables with same structure.
If there is an alternative or good solution do provide me with that.

regards,
CCSE
0
Comment
Question by:ccsenet
2 Comments
 
LVL 28

Accepted Solution

by:
imran_fast earned 300 total points
ID: 18059771
compare the two tables using any sql query will be much better and faster

Like


select Name  from table1 left outer join table2 on Table1.id = table2.id where table2.somefield is null
0
 
LVL 3

Assisted Solution

by:AbhishekSharma
AbhishekSharma earned 200 total points
ID: 18060800
execute following two query

1) Find the rows which are not present in first tabel

select * from table1 where table1.id not in (select ID from table2)

2) Find the rows which are not present in second tabel

select * from table2 where table2.id not in (select ID from table1)
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question