Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Newbie question on insert summary rows into dataset

Reply
Thread Tools

Newbie question on insert summary rows into dataset

 
 
Danny Ni
Guest
Posts: n/a
 
      04-09-2004
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


 
Reply With Quote
 
 
 
 
Danny Ni
Guest
Posts: n/a
 
      04-09-2004
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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Insert multiple rows from web form into database using java spring framework kate Java 0 05-04-2009 04:31 PM
How to dynamically insert rows into a Table control? gnewsgroup ASP .Net 6 10-31-2007 02:02 PM
Newbie: fastcsv: Read rows, print rows drubdrub@gmail.com Ruby 5 07-17-2007 03:09 AM
Howto insert delete rows into a ASP.net datagrid? Jimmy ASP .Net Datagrid Control 1 04-21-2005 04:58 AM
Can't seem to insert rows into a MySQL table grumfish Python 11 03-15-2005 11:06 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57