Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2006-12-02
2
Medium Priority
?
998 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 900 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 600 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

[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

971 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