Solved

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

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

813 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