DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Mon, 13 Aug 2007 16:08:56 +0330,    posted on: microsoft.public.dotnet.framework        back       

Thread Index
  1    Leon_Amirreza
          2    Alvin Bruney [MVP] some guy without an email address
                 3    Jani Jrvinen [MVP]


comparing DataSets?   
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:Mon, 13 Aug 2007 16:08:56 +0330   Author:  

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:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us