Click here to Skip to main content
15,884,836 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello sir currently i am working on hostel management project i want when i allot room to the sutdent only vacent room are show in dropdownlist from database and i can show how much room are alloted and how much are room are vacent ,how we can do
Posted
Updated 19-Jan-14 20:43pm
v2
Comments
OriginalGriff 18-Jan-14 4:52am    
And?
What have you tried?
Where are you stuck?
What part of this do you need help with?
Tejas Vaishnav 18-Jan-14 5:51am    
have you tried anything so far... and its not related to .net its related to your database...
Karthik_Mahalingam 20-Jan-14 3:20am    
post your code..

just simple yeah fix the number rooms in hostel just bool variable as a base for that attribute and if the attribute is true the room is allocated other else the room is vacant in main form just show allocated and vacant rooms
 
Share this answer
 
Just make another field in table having name IsVacant and having datatype int or bit
specify if room is alloted then the IsVacant 1 else it is 0
Then you have to just code in sql like that for dropdown

select * from TableName where IsVacant=0


this query returns list of vacant room only..

You can count also with group by clause
like that.. :)

select count(*) from TableName group by IsVacant


It gives you count of alloted as well Vacant rooms
 
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