Click here to Skip to main content
15,912,329 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all,

in my project i am having booking of conferenceroom and displaying in gridview.my question is if someone books the room and it get displayed in gridview if that activity is completed it should be deleted in that gridview i.e only latest should display no older activities.

the changes will come in storedprocedures or in code.

please any one suggest me.
Posted

From Store procedure fetch only that records whose date and time is less than current time.
i.e.
SQL
SELECT   * FROM  Booking WHERE (DATE_Book > '2010-02-24')

Additionally you can filter with time also.
Then assign fetched result to Gridview.

Mark as Answer/Solution, if it is helpful to you.
 
Share this answer
 
in storedprocedures

storedprocedures should take care of this, grid is only to display data

or u can show all data with different display scheme.
 
Share this answer
 
Comments
mandarapu 25-Feb-11 7:11am    
can u please explain with code.
pankajupadhyay29 25-Feb-11 7:14am    
give me your detailed table structure and procedure you are using then after only i can give u the code.In general case you should change your query to get all active booking i.e. booking end date is less then current date.
mandarapu 25-Feb-11 7:22am    
dbo.ConferenceRoom
EmployeeID nchar(7) Checked
PurposeOfBooking varchar(MAX) Checked
StartDate datetime Checked
EndDate datetime Checked
StartTime time(7) Checked
EndTime time(7) Checked
ConferenceRoom varchar(50) Checked



i am using this procedure for getting all data into gridview.
ALTER PROCEDURE [dbo].[SPGetConferenceRoom]
AS
BEGIN
SELECT * FROM ConferenceRoom
END
Dave Paras 25-Feb-11 7:30am    
Add WHERE clause to apply filter.
See below posted answer posted by Dave Parth
mandarapu 25-Feb-11 8:33am    
actually i used startdate and enddate in tables hw i need to use.
In a ideal world, I would put this in the data layer (i.e. stored procedure). This stored procedure would return me all the bookings which are currently active.
 
Share this answer
 
When someone books a room, you can use trigger/stored procedure to pass some value to the front-end.
On checking this value, you can re-bind the gridview with the updated data.
 
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