Hi Alan,
As Cor has mentioned, one way is to directly add the Table into the Typed
DataSet's Tables collection, however, that make it necessary to
explicitlyl
cast it when accesing it again from the Tables Collection.
Also, the 2.0 DataTable class provide a "Load" function which can load
data
from an IDataReader instance, so you can create a IDataReader instance
from
an existing TypeDataTable through its CreateDataReader method. e.g:
==================
DataSet1 ds1 = new DataSet1();
DataSet1TableAdapters.CategoriesTableAdapter tda = new
DataSet1TableAdapters.CategoriesTableAdapter();
DataSet1.CategoriesDataTable ct = tda.GetData();
ds1.Categories.Load(ct.CreateDataReader());
GridView1.DataSource = ds1.Categories;
GridView1.DataBind();
===============
This makes a bit overhead, but will work in case you have an existing
Typed
DataTable which has been filled indepently from Typed DataSet and want to
merge it into the dataset...
Regards,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Cor Ligthert [MVP]" <
[email protected]>
| References: <
[email protected]>
<#
[email protected]>
<
[email protected]>
| Subject: Re: How do I assign a typed DataTable to its typed DataSet?
| Date: Sun, 29 Jan 2006 17:51:39 +0100
| Lines: 21
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| X-RFC2646: Format=Flowed; Response
| Message-ID: <
[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.adonet
| NNTP-Posting-Host: ip3e830773.speed.planet.nl 62.131.7.115
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.adonet:119745
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
|
| Alan,
|
| You have created a typed dataset and a typed datatable
| In windowsform VS2005 are that a classes which you can see with the file
| name xx.designer.cs
|
| As soon as you start to add something to one where not is a typed method
| for, than it becomes in my opinion part of adding untyped that to it.
|
| ds.Tables.Add(mytypedDataset)
|
| To use it, you will than probably constantly have to use the casting or
set
| a new reference.
|
| MyTable = (TypedDataTableName) ds.Tables[x];
|
| Not tried just my idea about this.
|
| Cor
|
|
|