Re: Typed DataSet Navigation (Multiple Tables)
- From: "Cor Ligthert [MVP]" <notmyfirstname@xxxxxxxxx>
- Date: Tue, 13 Jun 2006 18:40:19 +0200
Rick,
The idea is creating a filter on a parent DataView and then getting aIf you use a filter with the same keys as the relation, than the relation
SINGLE DataView from the child in which contains ALL relating DataRows
/ DataRowViews that essentially pass through the filter.
has no sense anymore.
AFAIK is it impossible to get returned from a relation direct a datatable
(you can get the childrows by using parent.GetChildRows()). Therefore is
that faking with the dataview.
That sample is the first I gave you. Did you look at it?
Co
"Rick" <rryerson@xxxxxxxxxx> schreef in bericht
news:1150215035.005248.186990@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
This method only returns the associated 'rows' for the particular data
row view. But applying a filter to the parent view will contain
multiple rows. I am trying to do this WITHOUT iteration and populating
arrays, collections, etc.
The idea is creating a filter on a parent DataView and then getting a
SINGLE DataView from the child in which contains ALL relating DataRows
/ DataRowViews that essentially pass through the filter.
I would have thought this was possible with a Typed DataSet with
DataRelations.
Consider Northwind. I want to populate a DataGrid with [Order Details]
that are "associated" to orders in which EmployeeId = 5 created.
I don't want to see a DataGrid (or any other controls) with the Orders,
I just want to see and manipulate the order details. (For instance
EmployeeId entered every price with the wrong discount, and I need to
update them, BUT from a single DataView). Also, I want this in a single
DataView, so I don't have to iterate/select the Orders.
Or from the reverse relationship, I would like to see all the orders in
which contain a [order detail] for ProductId = 5. I just want to see
the "associated" Table, in this case here, the Orders (Not Order
Details).
Also, the references to DataGrid are for examples, I am not using ANY
controls what so ever. This is all code, for a Windows Service.
Best regards,
Rick
Cor Ligthert [MVP] wrote:
Rick,
Please keep it with one message thread, now people start answering new
again.
As I read the other message than is the only thing you need the property
"Row"
dr = drv.row; \\\gives the associated row from a drv
I hope this helps,
Cor
"Rick" <rryerson@xxxxxxxxxx> schreef in bericht
news:1150203916.047593.236030@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Cor,
Thanks for example. However, this really doesn't meet my needs. I can
do this by binding the DataSet to controls (2 data grids) but I need to
be able to do this in code as this is for a windows service.
I need to be able to filter one of the tables and get a view from the
other table(s) that will only contain associated records.
Best regards,
Rick
Cor Ligthert [MVP] wrote:
Rick,
With a version 2.0 typed dataset this is a piece of cake.
With 1.1 I assume that most people have taken the route from the non
typed
dataset (it is not changed for nothing in my idea).
I thought that this sample shows a little bit your needs
http://www.vb-tips.com/default.aspx?ID=cb1408ff-030d-4ea8-80b1-af26354b1fa0
I hope this helps,
Cor
<rryerson@xxxxxxxxxx> schreef in bericht
news:1150145592.200147.257100@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I don't know if my terminology is correct so please bear with me.
I have a Typed DataSet that contains a number of related Tables. I
am
trying to filter the parent table, child table and then traverse a
grand child table with the expected result of the only grand child
records in the data view would be those related to the Parent/Child
and
pass through the filter.
I can't seem to do this.
I could possibly be able to extend an answer that is based on
Northwind
Orders and order Details. I.e. I want to see only Order Detail
records
in the Dataview that pass the filter applied to the master Orders
(Orders.EmployeeId = 6 [I only want to see Order Details that relate
to
Employee 5])
If someone could please help me understand the process of setting
this
up, I would greatly appreciate it.
.NET 1.1 or 1.0.
Best regards,
Rick
.
- Follow-Ups:
- References:
- Typed DataSet Navigation (Multiple Tables)
- From: rryerson
- Re: Typed DataSet Navigation (Multiple Tables)
- From: Cor Ligthert [MVP]
- Re: Typed DataSet Navigation (Multiple Tables)
- From: Rick
- Re: Typed DataSet Navigation (Multiple Tables)
- From: Cor Ligthert [MVP]
- Re: Typed DataSet Navigation (Multiple Tables)
- From: Rick
- Typed DataSet Navigation (Multiple Tables)
- Prev by Date: Re: Alternative to Dataset??
- Next by Date: Re: IDataParameter - output parameter returns weird results
- Previous by thread: Re: Typed DataSet Navigation (Multiple Tables)
- Next by thread: Re: Typed DataSet Navigation (Multiple Tables)
- Index(es):
Relevant Pages
|