PC Review


Reply
Thread Tools Rate Thread

comparing DataSets?

 
 
Leon_Amirreza
Guest
Posts: n/a
 
      13th Aug 2007
dataset1.table1 is filled from a table in a database
dataset2.table1 is filled from a table in a database

How can I programatically compare the two tables to see if their schemas are
compatible (Same column definitions and contraints and keys...) and can be
merged or not?

 
Reply With Quote
 
 
 
 
Alvin Bruney [MVP]
Guest
Posts: n/a
 
      15th Aug 2007
Perhaps the easiest and cheapest way is to perform the merge. If the schemas
are the same, all is well. Otherwise, they are not and you will get an
exception that you can handle appropriately.

--
Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET - MS Press
Professional VSTO 2005 - Wrox/Wiley
OWC Black Book www.lulu.com/owc

"Leon_Amirreza" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> dataset1.table1 is filled from a table in a database
> dataset2.table1 is filled from a table in a database
>
> How can I programatically compare the two tables to see if their schemas
> are
> compatible (Same column definitions and contraints and keys...) and can be
> merged or not?
>



 
Reply With Quote
 
Jani Järvinen [MVP]
Guest
Posts: n/a
 
      16th Aug 2007
Hello!

> Perhaps the easiest and cheapest way is to perform the merge. If the
> schemas are the same, all is well.


I agree with Alvin, this is probably the easiest way to proceed. However,
depending on your needs, the ConstraintException that is raised (in case of
schema mismatch) might not give you enough details what's different in the
schemas.

Then, the remedy would be to loop through the elements in the Table.Columns
collection, and after that check for example primary keys, etc.

Hope this helps!

--
Regards,

Mr. Jani Järvinen
C# MVP
Helsinki, Finland
(E-Mail Removed)
http://www.saunalahti.fi/janij/


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Comparing Two DataSets Will Lastname Microsoft ASP .NET 19 19th Sep 2005 03:39 PM
Comparing Datasets =?Utf-8?B?SmFtZXNXaWxjZQ==?= Microsoft C# .NET 3 29th Mar 2005 03:12 PM
Comparing two datasets =?Utf-8?B?amFjZXc=?= Microsoft Dot NET 1 10th Aug 2004 07:11 AM
Comparing two datasets =?Utf-8?B?S3NoaXRpag==?= Microsoft Dot NET 3 23rd Mar 2004 01:21 PM
Comparing Datasets Nate Zobrist Microsoft ADO .NET 6 18th Mar 2004 05:32 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:11 AM.