Solved

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

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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
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…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

947 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

23 Experts available now in Live!

Get 1:1 Help Now