PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Related rows within a typed dataset: How to make them work?
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Related rows within a typed dataset: How to make them work?
![]() |
Related rows within a typed dataset: How to make them work? |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Good morning,
I have a typed dataset that is composed of a few tables. I usually just use the typed dataset for loading / updating and working with data at the table level (and not at the DataSet level). In other words, I usually get DataTables using DataAdapters and update similarily. I noticed recently that a strongly typed DataRow has a reference to the related row in another table in the dataset. For instance, if I have two related tables: TableA and TableB, then the typed rows "TableARow" would have a property exposing the related row, "TableBRow". Navigating that object shows that it is a DataRow for the related table. My question is how do I get that related row to contain data? The TableA datatable is being populated with a GetDataBy... method call. My hunch is that the relationship is superficial, and no data will be there, unless I take measures to fill the ENTIRE dataset... which is far from ideal. I'm struggling with where to find more information on this as well. If anyone has any experience with related tables or related DataRows in typed DataSets, any advice would be appreciated. best regards, -Sean |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Hi Sean,
"Sean F. Aitken" <sean.aitken@gmail.com> wrote in message news:1158240163.809926.205500@d34g2000cwd.googlegroups.com... > Good morning, > > I have a typed dataset that is composed of a few tables. I usually just > use the typed dataset for loading / updating and working with data at > the table level (and not at the DataSet level). In other words, I > usually get DataTables using DataAdapters and update similarily. > > I noticed recently that a strongly typed DataRow has a reference to the > related row in another table in the dataset. For instance, if I have > two related tables: TableA and TableB, then the typed rows "TableARow" > would have a property exposing the related row, "TableBRow". Navigating > that object shows that it is a DataRow for the related table. > > My question is how do I get that related row to contain data? The > TableA datatable is being populated with a GetDataBy... method call. > My hunch is that the relationship is superficial, and no data will be > there, unless I take measures to fill the ENTIRE dataset... which is > far from ideal. Right, but you don't have to fill entire dataset - just rows that you need. > I'm struggling with where to find more information on this as well. If > anyone has any experience with related tables or related DataRows in > typed DataSets, any advice would be appreciated. You are stuck with loading all necessary data by yourself (either using an adapter per table or an adapter that returns more recordsets). -- Miha Markic [MVP C#, INETA Country Leader for Slovenia] RightHand .NET consulting & development www.rthand.com Blog: http://cs.rthand.com/blogs/blog_with_righthand/ |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

