Click here to Skip to main content
16,022,296 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
| players|
| ------- |
| player1 |
| player1 |
| player2 |
| player2 |
| player2 |

if im going to click player 1 the label will show how many player1 inside a table
and so on.

What I have tried:

<string stmt = "SELECT EventName, COUNT(EventName) as count FROM EventTb GROUP BY EventName";

i'm a beginner sorry i only have the query
Posted
Updated 20-Jan-19 18:59pm

1 solution

here is my solution, i haven't tried it now but i've used it earlier. hope so this will work for you

C#
string cmd = "SELECT COUNT(EventName) as count FROM EventTb";
con.open();
sqlCommand sqlcmd = new sqlCommand(cmd);
lblNumberOfPlyers.Text = sqlcmd.ExecuteScalar();
con.close();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900