Click here to Skip to main content
15,306,245 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have a 3 table like as shown in bellow

ID RoomId ComingForm
1 1 Hyderabad
2 2 Hyderabad
3 3 Hyderabad
4 3 Chennai
6 2 Chennai
7 1 Chennai
8 3 Chennai

ID RoomName RoomClassId
1 101 2
2 102 2
3 103 1

ID RoomClassName
1 Luxury
2 Normal

Result will be
CommingForm Luxury Narmal
Hyderabad 2 1
Chennai 2 2

these are the count of luxury rooms occupied by the Hyderabad people etc..

plz help me...

1 solution

you can do this in a query in the database. Create a stored procedure for it and use the information you can find in my article Dynamic Pivoting with Cubes and eventhandlers in SQL Server 2005, 2008 and 2008 R2[^].
All you have to do is call the stored procedure and read the dataset/datatable from your database.

to have LINQ call a stored procedure read:[^]

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