Solved

Calender Control

Posted on 2004-04-29
6
308 Views
Last Modified: 2010-04-24
How I Create a my own calendar using calender control and using sql databases
0
Comment
Question by:sdbit6
  • 2
6 Comments
 
LVL 6

Expert Comment

by:zulu_11
ID: 10946891
please clarify what is it exactly that you want?
0
 
LVL 51

Accepted Solution

by:
Ryan Chong earned 63 total points
ID: 10946983
Try use the Date Time Picker Control? I thought the UI is good enough already..
0
 
LVL 1

Assisted Solution

by:Trancedified
Trancedified earned 62 total points
ID: 11054653
There is a control called the DateTimePicker. I assume you are using a date range with the SQL BETWEEN clause.

So make one DateTimePicker your "Start Date" and one your "End Date" Make sure for both of these controls, go to the Value Property and remove the time out of there so there's only a date.

To "use" the datetimepicker w/ a SQL query do something like:

Dim strSQL As String

strSQL = "SELECT * FROM MYTABLE "
strSQL &= "WHERE [My Date Field] BETWEEN " & "'" & DateTimePickerStart.Value & "'" & _
                " AND " & "'" & DateTimePickerEnd.Value & "'"

So the query in plain SQL will look like:

SELECT * FROM MYTABLE WHERE [My Date Field] BETWEEN '4/5/2003' AND '12/31/2004'

That should return all records between those two date ranges.
Notice the "'" & DateTimePickerStart.Value & "'"               is    quote apostrophe quote      like:

"'"
Let me know if that was ok?

Chris
0
 
LVL 1

Expert Comment

by:Trancedified
ID: 11250322
TheLearnedOne,

Hi Bob, splitting points will be nice since the original author said "....and using sql databases." I just think my example could have been more useful or "thorough." I'm fine either way. Thanks for helping me in my other posts :)


Chris
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question