Get compute by results into a datagridview

itmagr

Member
Joined
Feb 8, 2008
Messages
6
Programming Experience
3-5
This sql statement
SELECT customer, value
FROM orders
ORDER BY customer
COMPUTE SUM(value)by customer
returns multiple results in Query Analyzer.
Can I get all these results into one datagridview.
I am doing
cmd.CommandText = sqlstatement
cmd.Connection = DataConnection
Dim r As SqlDataReader = cmd.ExecuteReader()
Dim myDataTable As New DataTable
myDataTable.Load(r)
r.Close()
grid1.DataSource = myDataTable
but only get results for the first customer with no total.
If not, how do you get a grid with control-break total lines,

TIA
 

Latest posts

Back
Top