Count the records from DB and Display in UI

Posted by Jayashree under C# on 5/23/2011 | Points: 10 | Views : 1644 | Status : [Member] | Replies : 1
I have Question table and Category table.Based on category some 30 questions are there.I need to count the total no of Questions in particular category and display into the UI when Particular user logged in.I m using with C# code. Help me pls.



Posted by: Lakhwinder.ghuman on: 5/23/2011 [Member] Starter | Points: 25

its very simple

You can write a query like

Select CategoryTable.CategoryId,Count(QuestionTable.QuestionId) as NoOfQuestions from QuestionTable,CategoryTable
where QuestionTable.CategoryId=CategoryTable.CategoryId
Group By CategoryTable.CategoryId

Best Regards
Lakhwinder Ghuman

Jayashree, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response