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:
hi..
i have a 3 table like as shown in bellow

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

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

RoomClass
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...
Posted

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: http://weblogs.asp.net/scottgu/archive/2007/08/16/linq-to-sql-part-6-retrieving-data-using-stored-procedures.aspx[^]
   
v2

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