Advertisement

07.20.2002 at 08:24PM PDT, ID: 20325980
[x]
Attachment Details

Compare 2 DataTables

Asked by tnewc59 in .NET

Tags: compare, datatables, 2

I will have 2 populated data tables:  

dtMyTable1
dtMyOtherTable

Here is the interface of the method that I would like to see a working example of:
Public Sub(byval Dt1 as datatable, byval Dt2 as datatable, byref DtInBoth as datatable, byRef DtOnlyInFirst as DataTable)

(I know, this is probably really simple to accomplish, but I am new to .NET...)

Definition of the fields being passed in:
Dt1 --> First data table to compare
Dt2 --> Second data table to compare
DtInBoth -->  Return datatable that contains only the rows found in both datatables
DtOnlyInFirst -->  Return datatable that contains the records that were only found in the first datatable

I would prefer an example in VB.NET, but will accept C# as well.
Start Free Trial
[+][-]07.21.2002 at 07:19AM PDT, ID: 7167733

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.21.2002 at 02:07PM PDT, ID: 7168224

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.22.2002 at 01:40AM PDT, ID: 7168862

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: .NET
Tags: compare, datatables, 2
Sign Up Now!
Solution Provided By: wford
Participating Experts: 2
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32