Re: comparing DataSets?
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" wrote in message
news:%23l5XMca3HHA.1184@TK2MSFTNGP04.phx.gbl...
> 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?
>
Date:Tue, 14 Aug 2007 19:05:40 -0400
Author:
|
Re: comparing DataSets?
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 Jrvinen
C# MVP
Helsinki, Finland
janij@removethis.dystopia.fi
http://www.saunalahti.fi/janij/
Date:Thu, 16 Aug 2007 18:48:58 +0300
Author:
|