Newbie question on insert summary rows into dataset

Discussion in 'ASP .Net' started by Danny Ni, Apr 9, 2004.

  1. Danny Ni

    Danny Ni Guest

    Hi,

    Is there a way to insert summary rows into a dataset or datareader without
    actually save them back to the SQL server?

    I have a resultset returned by SQL server using the following SQL statement:
    select gid, eid, wdate, whours from timelog order by gid, eid, wdate

    I like to insert a summary row for every eid and gid.
    For example, the following dataset or datareader:
    gid eid wdate whours
    ------------------------------------
    1 101 1/1/04 8
    1 101 1/2/04 8
    1 102 1/1/04 7.5
    1 102 1/2/04 6.5

    will become
    gid eid wdate whours
    ------------------------------------
    1 101 1/1/04 8
    1 101 1/2/04 8
    1 101 null 16
    1 102 1/1/04 7.5
    1 102 1/2/04 6.5
    1 102 null 14
    1 null null 20

    Thanks in Advance
    Danny Ni, Apr 9, 2004
    #1
    1. Advertising

  2. Danny Ni

    Danny Ni Guest

    Never mind. I post this question to ado.net group for a better fit.

    "Danny Ni" <> wrote in message
    news:...
    > Hi,
    >
    > Is there a way to insert summary rows into a dataset or datareader without
    > actually save them back to the SQL server?
    >
    > I have a resultset returned by SQL server using the following SQL

    statement:
    > select gid, eid, wdate, whours from timelog order by gid, eid, wdate
    >
    > I like to insert a summary row for every eid and gid.
    > For example, the following dataset or datareader:
    > gid eid wdate whours
    > ------------------------------------
    > 1 101 1/1/04 8
    > 1 101 1/2/04 8
    > 1 102 1/1/04 7.5
    > 1 102 1/2/04 6.5
    >
    > will become
    > gid eid wdate whours
    > ------------------------------------
    > 1 101 1/1/04 8
    > 1 101 1/2/04 8
    > 1 101 null 16
    > 1 102 1/1/04 7.5
    > 1 102 1/2/04 6.5
    > 1 102 null 14
    > 1 null null 20
    >
    > Thanks in Advance
    >
    >
    Danny Ni, Apr 9, 2004
    #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. grumfish
    Replies:
    11
    Views:
    721
    Andy Dustman
    Mar 15, 2005
  2. gnewsgroup
    Replies:
    6
    Views:
    572
    gnewsgroup
    Oct 31, 2007
  3. kate
    Replies:
    0
    Views:
    2,991
  4. Jimmy

    Howto insert delete rows into a ASP.net datagrid?

    Jimmy, Apr 20, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    118
  5. Replies:
    5
    Views:
    155
    James Edward Gray II
    Jul 17, 2007
Loading...

Share This Page