Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 30th, 2009, 08:28 AM
Authorized User
Points: 343, Level: 6
Points: 343, Level: 6 Points: 343, Level: 6 Points: 343, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2009
Posts: 74
Thanks: 5
Thanked 0 Times in 0 Posts
Default how can I compare dates in a sqlserver database to

Please how can I compare dates in a sqlserver database to dates on a calendar in order to determine the dates that a particalar room is free for booking.

I am trying to create a room reservation system, however I am having some strains.
here is what I am trying to do:
a customer should be able to view available dates for a particular room.I mean dates on which this room is free, so that he does not book a room that has already been taken on the time period he specifies he will be staying in the hotel.
please can anyone give me some help on this?

. Or is there another way I can do this. Thanks
  #2 (permalink)  
Old December 3rd, 2009, 04:19 PM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

This is what I have done in the past. I created a datatable with all the info I needed, including the date(s) needed. Then, in the DayRender event of the calendar, I looped through all the rows in the datatable and compared the dates:

Code:
ForEach dr As DataRow In dt.Rows
  IfDirectCast(dr("YourDateColumn"), DateTime).Date = e.Day.Date Then
     .. DO STUFF HERE
End If
  #3 (permalink)  
Old December 4th, 2009, 07:02 AM
Authorized User
Points: 343, Level: 6
Points: 343, Level: 6 Points: 343, Level: 6 Points: 343, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2009
Posts: 74
Thanks: 5
Thanked 0 Times in 0 Posts
Default Thanks

Thanks alot, lot, will try the code, but could U help convert the code to c#, am kind of a rookie programmer and have little experience with vb...

thanks .
  #4 (permalink)  
Old December 4th, 2009, 11:00 AM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

There are code converters on-line. Just use Google.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to compare two dates lakshmi_annayappa Javascript 1 September 3rd, 2007 08:52 AM
How do I compare 2 dates? Lucy Classic ASP Basics 1 May 3rd, 2005 07:24 PM
Compare dates langer123 Classic ASP Basics 2 April 16th, 2005 08:57 AM
Compare dates [problem]... Varg_88 VB Databases Basics 3 August 20th, 2004 09:55 AM
Compare Dates in JS apd8x Javascript 4 June 16th, 2003 08:27 AM



All times are GMT -4. The time now is 04:33 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.