Solved

Compare Two Data-Sets

Posted on 2011-03-14
5
346 Views
Last Modified: 2012-05-11
Hi Experts!

I am modifying an app that was handed on to me...

I need to compare insurance claims at two points in time.  I only need to report claims that have changed in value from Date 1 to Date 2 based on certain values; i.e. Total_Paid for example.  

I have two stored procedures that pull claim data as of 1/1/2010 and then another that pulls the claim data as of 1/1/2011.  I then want to compare Total_Paid_Amount_2010 to Total_Paid_Amount_2011. If its different, I write both records to a text file.

I'm  not familiar with datasets, datatables, etc.  Is this the best way to do  this?  Could anyone provide a generic example of obtaining the dataset, putting into data tables and then comparing the data.  I'm under a very tight time constraint....
0
Comment
Question by:tobin46
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 9

Assisted Solution

by:sshah254
sshah254 earned 150 total points
ID: 35134656
I would do this in SQL if I were you.  It will be much faster there.

Essentially there will be a table, or bunch of tables that hold the data for the claim.

But if you are unfamiliar with SQL, or do not have the schema of your database, then you should stick to what is familiar to you.

Ss
0
 
LVL 1

Author Comment

by:tobin46
ID: 35134734
I'm much better in SQL than VB.Net.  Can you provide an example as to how I could accomplish it there....

The stored procedure is rather long and complicated because of the database schema.  

Can you provide a generic example, logic, psuedocode...?
0
 
LVL 1

Author Comment

by:tobin46
ID: 35134749
I'd prefer a Vb.Net solution.....I think.  Only because this has a few moving parts to it outside of the claim comparison.  
0
 
LVL 16

Assisted Solution

by:Kalpesh Chhatrala
Kalpesh Chhatrala earned 150 total points
ID: 35135438
0
 
LVL 7

Accepted Solution

by:
foobarr earned 200 total points
ID: 35150838
if you have two datasets

dset1
dset2

for each dRow1 as datarow in dset1.tables(0).rows
     for each drow2 as datarow in dset2.tables(0).rows
            if drow1("column name") = drow2("column name")
                     'condition is true
                     exit for
           else
                     'condition is false
           end if
     next
next


basically you take the first dataset, for each row in that dataset you compare it against all of the rows in the second dataset.  For your condition statement, whatever you are checking, if you have found what you are looking for then you can exit the second for loop and then it will check the next row all over again.


but I would suggest doing this comparison in sql in your database.  
what does your stored procedure look like right now?




0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

717 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