H
H5N1
Hello everybody!
I'm new to asp.net 2.0 (so please forgive me my lameness) and I haven't
yet fully grasped the ObjectDataSource, which hopefully will change
with your help.
I'm designing web app and would like to visualise (among others) the
following data structure:
___________
| |
| events |
-----------|
| |
| |
------------
| 1
|
| *
___________
| event |
| costs |
-----------|
| value |
------------
| *
|
| 1
____________
| |
| costs |
-----------|
| |
| |
------------
So, there's lot of events, lot of cost types, and some events have some
costs equal to 'value'.
Actually it's just two tables with many-to-many relationship resolved
by an association table.
Now, I'd like to build a form to display this data in a tabular manner:
cost1 cost2 cost3
event1 13$ 45$
event2 5$
event3 15$
event4 4$
The question is: how can I do it with GridView and ObjectDataSource
duo?
I guess it's quite problematic, since such table could not be the
output of any single SELECT query (right?).
What my vague intuitions tell is that it could work by using some
business object EventCosts that would have access to all three tables
(by some TableAdapters?) and using this information it could fill, cell
by cell, some data structure that could feed the webform. If there
exist EventCost which has relationship to given cost and given event,
its value would be filled in intersection of their column/row.
Unfortunately the columns number could easily change (by adding new
cost) so would it be possible to use typed dataset to exchange
information between biz object and GridView?
I know it all may look very vague, but I would be very gratefull if
yanybody could sketch the optimal structure, or just the approach, for
solving this problem (I ask about dataset, but I not sure of the rest
either). I'm sure it will help me a lot to understand those basic net
2.0 concepts.
thanks a lot
Hapiec
I'm new to asp.net 2.0 (so please forgive me my lameness) and I haven't
yet fully grasped the ObjectDataSource, which hopefully will change
with your help.
I'm designing web app and would like to visualise (among others) the
following data structure:
___________
| |
| events |
-----------|
| |
| |
------------
| 1
|
| *
___________
| event |
| costs |
-----------|
| value |
------------
| *
|
| 1
____________
| |
| costs |
-----------|
| |
| |
------------
So, there's lot of events, lot of cost types, and some events have some
costs equal to 'value'.
Actually it's just two tables with many-to-many relationship resolved
by an association table.
Now, I'd like to build a form to display this data in a tabular manner:
cost1 cost2 cost3
event1 13$ 45$
event2 5$
event3 15$
event4 4$
The question is: how can I do it with GridView and ObjectDataSource
duo?
I guess it's quite problematic, since such table could not be the
output of any single SELECT query (right?).
What my vague intuitions tell is that it could work by using some
business object EventCosts that would have access to all three tables
(by some TableAdapters?) and using this information it could fill, cell
by cell, some data structure that could feed the webform. If there
exist EventCost which has relationship to given cost and given event,
its value would be filled in intersection of their column/row.
Unfortunately the columns number could easily change (by adding new
cost) so would it be possible to use typed dataset to exchange
information between biz object and GridView?
I know it all may look very vague, but I would be very gratefull if
yanybody could sketch the optimal structure, or just the approach, for
solving this problem (I ask about dataset, but I not sure of the rest
either). I'm sure it will help me a lot to understand those basic net
2.0 concepts.
thanks a lot
Hapiec