Binding tables interesection with GridView/ObjectDataSource [newbie]

Discussion in 'ASP .Net Datagrid Control' started by H5N1, Mar 27, 2006.

  1. H5N1

    H5N1 Guest

    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
     
    H5N1, Mar 27, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. H5N1
    Replies:
    0
    Views:
    493
  2. =?Utf-8?B?UGhpbGlw?=

    GridView - ObjectDataSource - Data Binding

    =?Utf-8?B?UGhpbGlw?=, Oct 24, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    1,028
    =?Utf-8?B?UGhpbGlw?=
    Oct 24, 2006
  3. Jeronimo Bertran

    Binding a GridView to a particular table in an ObjectDataSource

    Jeronimo Bertran, Apr 4, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    5
    Views:
    210
  4. Keith Patrick
    Replies:
    0
    Views:
    157
    Keith Patrick
    Dec 16, 2005
  5. SteveM

    Data Binding in GridView when using ObjectDataSource

    SteveM, Apr 1, 2009, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    1,088
    Ladislav Mrnka
    Apr 3, 2009
Loading...

Share This Page