question

BaijuEP-6339 avatar image
0 Votes"
BaijuEP-6339 asked BaijuEP-6339 commented

Count and display summary in asp.net+vb web from SQL Database

in my sql table i have following data

ID Product_Sent Sent Returned Damaged
01 Kite Red 10 08 04
02 Kite Blue 11 11 08
03 Kit Red 10 08 04
04 Kite Red 10 08 04
05 Kite Blue 11 11 08
06 Kit Red 10 08 04
07 Kit Green 5 5 3

I want result in asp.net+vb web Grid view like this

ID Product_Sent Sent Returned Damaged
01 Kite Red 40 32 16
02 Kite Blue 22 22 16
03 Kit Green 05 05 03

dotnet-aspnet-webforms
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @BaijuEP-6339 ,
According to your result, I have one question. In your sql table, the "Product_Sent""Kite" and "Kit" both have "Red""Sent". And then in your result, you count all "Red""Sent" ,but the "Product_Sent" is "Kite".Why? You only get the first value?
About your problems,I think, you only write a sql query that select the first value , Count the "Sent","Returned ","Damaged" group by the "Sent". And then fill the select data into the gridview. What' your error now?
Best regards,
Yijing Sun

0 Votes 0 ·

Thanks. It worked for me.

0 Votes 0 ·

0 Answers