S
Sam Matthews
I'm new to ADO.NET, and so far I am not too impressed.
After plowing through the pages and pages of fancy disconnected
relational blah blah, I find myself wanting to do something so simple
- that you wouldn't think twice about it in SQL. But in ADO.NET it
appears to be impossible - without resorting to hand coding all of it.
The more things change, the more they stay the same.
Here's what I want to do...
I have a series of related tables, for simplicity I will explain only
a subset. This is a classic 3 table "many to many" relationship. In
this case I have Securities, Exchanges, and ExchSec. Securities can
be traded on several exchanges, and Exchanges support many Securites -
represented by ExchSec.
I have setup a Typed Dataset complete with relations, foreign keys and
all that jazz.
I have a GUI upon which is places two databound controls. When the
user selects a Security, I would like to display the list of availible
Exchanges for that Security.
So far, I don't see one good way of utilizing the relations in place
for doing that.
DataTable.Select does what? Return an array of DataRow. What the
hell can I do with an array of DataRow in regards to a databound
control?
DataView.RowFilter takes a string expression that appears to allow a
relation to a Child - BUT ONLY if that child represents a single value
- otherwise you have to use an aggregate function - what the hell good
is that.
Once again the senerio is this - the user selects a Security. the
Exchange(s) where that Security can be traded are derived from
ExchSec, but only the IDs. The full Exchange Description must be
derived from Exchange. This is as old as the hills.
In SQL we are talking ...
SELECT Exchange.Description
FROM Exchange, Security, ExchSec
WHERE Exchange.ExchId = ExchSec.ExchId
AND Security.SecId = ExchSec.SecId
AND Security.SecId = "3"
SQL 101.
So in short, there seems to be no way to filter a dataset on a field,
and the multiple occurences of that field in a group, dataset, array,
collection or what have you.
I'm really disapointed.
Sam
After plowing through the pages and pages of fancy disconnected
relational blah blah, I find myself wanting to do something so simple
- that you wouldn't think twice about it in SQL. But in ADO.NET it
appears to be impossible - without resorting to hand coding all of it.
The more things change, the more they stay the same.
Here's what I want to do...
I have a series of related tables, for simplicity I will explain only
a subset. This is a classic 3 table "many to many" relationship. In
this case I have Securities, Exchanges, and ExchSec. Securities can
be traded on several exchanges, and Exchanges support many Securites -
represented by ExchSec.
I have setup a Typed Dataset complete with relations, foreign keys and
all that jazz.
I have a GUI upon which is places two databound controls. When the
user selects a Security, I would like to display the list of availible
Exchanges for that Security.
So far, I don't see one good way of utilizing the relations in place
for doing that.
DataTable.Select does what? Return an array of DataRow. What the
hell can I do with an array of DataRow in regards to a databound
control?
DataView.RowFilter takes a string expression that appears to allow a
relation to a Child - BUT ONLY if that child represents a single value
- otherwise you have to use an aggregate function - what the hell good
is that.
Once again the senerio is this - the user selects a Security. the
Exchange(s) where that Security can be traded are derived from
ExchSec, but only the IDs. The full Exchange Description must be
derived from Exchange. This is as old as the hills.
In SQL we are talking ...
SELECT Exchange.Description
FROM Exchange, Security, ExchSec
WHERE Exchange.ExchId = ExchSec.ExchId
AND Security.SecId = ExchSec.SecId
AND Security.SecId = "3"
SQL 101.
So in short, there seems to be no way to filter a dataset on a field,
and the multiple occurences of that field in a group, dataset, array,
collection or what have you.
I'm really disapointed.
Sam