Windows Develop Bookmark and Share   
 index > Windows Forms General > DateTimePicker format Question
 

DateTimePicker format Question

In my software i have used dateTimePicker control, its format is long,when user insert details its data stored in database.
now here is my problem, i want to sort that data between two dates but how i dont know, i have alreaddy inserted lots of data with long format of dateTimePicker.
i want to sort data between two dates, i have tried this query but it is not running.
select * from Table where Date>='dateTimePicker1.Text' and Date <='dateTimePicker.Text'
but this is not working, can any one tell me how can i sort data between two dates, i know in short format i can sort it but i have alreaddy inserted lots of data with long format.

neeravpatel  Friday, June 26, 2009 3:49 AM
Don't store dates as strings in the database. You'll have big problems when the database is used by a machine that runs with a different default culture. Or when you want to sort the records. Using a table column of type "date" is a pretty hard requirement.

Hans Passant.
nobugz  Friday, June 26, 2009 12:10 PM
Don't store dates as strings in the database. You'll have big problems when the database is used by a machine that runs with a different default culture. Or when you want to sort the records. Using a table column of type "date" is a pretty hard requirement.

Hans Passant.
nobugz  Friday, June 26, 2009 12:10 PM

You can use google to search for other answers

Custom Search

More Threads

• Different color for each listbox (or CB) item
• How to change the colours of standard Win32 scrollbars?
• Calculate size of listview based on items in it
• Using System.Drawing while creating a .dll file
• Scrolling Panel via HScrollbar flickers
• Writing sound events in windows vista control panel?
• Vector Drawing in C#
• AxSHDocVw.AxWebBrowser breaks on Windows 2003 Server
• Mouse wheel does not work on DataGrid
• Listview ColumnHeader