Hi Peter,
First of all, I would like to confirm my understanding of your issue. I'm
not quite sure about your question. I would like to know which value would
you like to summarise? The total amout or the count of orders? I understand
that if the grid is sorted on customer, the value has to be summarised for
each customer, while if it is sorted on products, the value has to be
summarised for each product. If there is any misunderstanding, please feel
free to let me know.
As far as I know the UNION operater in T-SQL manages to combines the
results of two or more queries into a single result set consisting of all
the rows belonging to all queries in the union. For example, we have two
tables with the same structure, we can use the following statement to
return all the records in both two tables.
SELECT * FROM Table1 UNION SELECT * FROM Table2
So I don't think UNION can do it for you in SQL server. You can try to use
SUM or COUNT functions in T-SQL to do statistics for specific values and
write additional codes to your application to display the summaries on the
grid. Here are some links for your reference.
http://msdn.microsoft.com/library/de...us/tsqlref/ts_
ca-co_5790.asp
http://msdn.microsoft.com/library/de...us/tsqlref/ts_
setu-sus_414d.asp
To customize the colors on the DataGrid, here is a good article for your to
start.
http://msdn.microsoft.com/library/de...us/dnwinforms/
html/wnf_custdatagrid.asp
Also, I have found some useful links for you to start learning .NET
framework and ADO.NET.
http://msdn.microsoft.com/library/de...us/netstart/ht
ml/sdk_netstart.asp
http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconoverviewofadonet.asp
HTH. If anything is unclear, please feel free to reply to the post.
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."