Solved

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

Posted on 2006-12-02
2
972 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now