Formatting result from a database query

Discussion in 'ASP .Net Datagrid Control' started by Mathias, Nov 21, 2006.

  1. Mathias

    Mathias Guest

    From my database query I get the following:

    Text Number
    Albert 12
    Albert 14
    Albert 16
    Brian 20
    Brian 21
    Brian 22

    Now I'd like to represent the data as:

    Albert 12 14 16
    Brian 20 21 22

    I've looked at repeaters, data sets, data readers but I can't figure
    out how to go about it. Preferably I'd like to represent the data in a
    GridView. Can anyone please guide me in the right direction? :)
    Mathias, Nov 21, 2006
    #1
    1. Advertising

  2. The easiest solution is to build programmatically a new datatable containing
    one row per name out of the original result set and databind the gridview to
    the new table.

    --
    Eliyahu Goldin,
    Software Developer & Consultant
    Microsoft MVP [ASP.NET]


    "Mathias" <> wrote in message
    news:...
    > From my database query I get the following:
    >
    > Text Number
    > Albert 12
    > Albert 14
    > Albert 16
    > Brian 20
    > Brian 21
    > Brian 22
    >
    > Now I'd like to represent the data as:
    >
    > Albert 12 14 16
    > Brian 20 21 22
    >
    > I've looked at repeaters, data sets, data readers but I can't figure
    > out how to go about it. Preferably I'd like to represent the data in a
    > GridView. Can anyone please guide me in the right direction? :)
    >
    Eliyahu Goldin, Nov 22, 2006
    #2
    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. Learner
    Replies:
    1
    Views:
    973
    Marina Levit [MVP]
    Jan 30, 2006
  2. J.Ram
    Replies:
    7
    Views:
    641
  3. Pavel
    Replies:
    7
    Views:
    513
    Pavel
    Sep 19, 2010
  4. Lakshmi Sreekanth

    i = 10; result = ++i - --i; How result become ZERO

    Lakshmi Sreekanth, Sep 21, 2010, in forum: C Programming
    Replies:
    52
    Views:
    1,151
    Nick Keighley
    Sep 23, 2010
  5. Michael Tan
    Replies:
    32
    Views:
    937
    Ara.T.Howard
    Jul 21, 2005
Loading...

Share This Page