Dear legends ,
Am a final year BSc Info Tech student..
Am doing the project on asp.net. in vb..
Tittle is "Online Voting"
Now am final stage as resulting page...
Now I have some troubles to show the voting result..
On my project votes are on the database..
ID Name VoteFor
1 Abc A
2 Cba B
3 acd A
4 Dcb A
So now i want to produce the result as
"the winner is A and he got 3 Votes"
Mano HaranPosted Aug 5, 2015, 12:55 AM
Mano HaranPosted Aug 5, 2015, 12:55 AM
Mano HaranPosted Jul 20, 2015, 2:23 AM
Manoj BhoirPosted Jul 19, 2015, 10:04 AM
Select TOP(1) VoteFor, Count(*)As TotalVotes From Vote Group By VoteFor Order By TotalVotes Desc
This query will give you Single Record with highest Votes. Using SQLReader and ExecuteReader of SQLCommand you can display your final result.Manas MohapatraPosted Jul 19, 2015, 7:45 AM