PC Review


Reply
Thread Tools Rate Thread

Combining and relating DataTables from different typed DataSets in

 
 
=?Utf-8?B?TWFyYyBXb29sZnNvbg==?=
Guest
Posts: n/a
 
      2nd Oct 2007
We have been provided with a set of typed DataSets which we wish to merge
into the one DataSet, adding any additional relationships between DataTables
as appropriate. We wish to use Visual Studio.NET 2005 to visualise and
manipulate the various tables in order for all of the typed methods that deal
with relations to be generated on the DataTables within the final DataSet.

We believe that it is possible to modify the DataSet schema file to import
and extend DataTables from other DataSets but we are unable to successfully
implement this. The article at
http://www.devx.com/dotnet/Article/20945/0/page/1 was very useful but failed
to give us the level of information required.

Our scenario is as follows:

* A DataSet 'DataSet1' contains a DataTable 'Table1' with a primary key
column 'Table1PK'
* Another DataSet 'DataSet2' contains a DataTable 'Table2' which contains a
primary key column 'Table2PK' and a foreign key column 'Table1FK'

We wish to, through the visual designer or (most likely) directly in the XSD:

* Import Table1 into DataSet2
* Add a relation between Table1FK in Table2 and Table1PK in Table1 in DataSet2
* Automatically generate the typed methods on imported Table1 and Table2
corresponding to the relation between them

We wish to reference rather than replicate Table1 in DataSet2 so that any
changes that may be made to Table1 in DataSet1 propagate through to DataSet2.

Please could an expert point us in the right direction, or supply some
examples as to how the above may be achieved?

Thanks,

Marc
 
Reply With Quote
 
 
 
 
Cor Ligthert[MVP]
Guest
Posts: n/a
 
      4th Oct 2007
Marc,

A strongly typed dataset is nothing more then a class created (wrapped)
around an dataset.
If you open in your solution explorer in top Show all files (it is an icon
not always visible), then you will see that.

It is easy to combine non strongly typed dataset, by just adding the table
to that and set the relation. You even can do that with a strongly typed
dataset, however in the latter you can then not use the strongly typed
members from those however have to use it non strongly typed.

Cor

 
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
Re: ASP/ADO/VB.NET: How to update multiple datatables with typed datasets ? Bauhaus Microsoft ADO .NET 6 14th May 2008 06:06 PM
ASP/ADO/VB.NET: How to update multiple datatables with typed datasets ? Bauhaus Microsoft ASP .NET 0 10th May 2008 05:55 PM
Typed datasets with multiple datatables? =?Utf-8?B?RGF2ZQ==?= Microsoft ADO .NET 1 30th Apr 2007 05:36 PM
Inheriting Typed DataSets and DataTables =?Utf-8?B?UnlhbiBTaGF3?= Microsoft Dot NET Framework 4 20th May 2004 02:16 PM
Inheriting Typed DataSets and DataTables =?Utf-8?B?UnlhbiBTaGF3?= Microsoft VB .NET 1 20th May 2004 01:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:32 PM.