473,325 Members | 2,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

looking for a Date Time Control..

RSB
Hi Every one ,
IS there any Date Time Control with .Net. All i want to read is the Date and
Time in a Single Field like 12/31/2004 09:23:23AM.
if there is any then any examples for it. and if not then how to Validate
the Text field for above.

thanks
RSB
Nov 18 '05 #1
3 3686
You can use CompareValidator by setting
Operator property to DataTypeCheck and Type property to DateTime, then for
the control set in the ControlToValidate the CompareValidator will get the
entered data and will try to convert it to the given type. if the data is
incorrect the CompareValidator will rise an error messsage.

When you use Operator=DataTypeCheck then the ControlToCompare is ignored

Regards
Martin

"RSB" <rs*****@hotmail.com> wrote in message
news:#H**************@TK2MSFTNGP09.phx.gbl...
Hi Every one ,
IS there any Date Time Control with .Net. All i want to read is the Date and Time in a Single Field like 12/31/2004 09:23:23AM.
if there is any then any examples for it. and if not then how to Validate
the Text field for above.

thanks
RSB

Nov 18 '05 #2
RSB
Hi Martin,
Thanks for he reply..
Now i was checking the CompareValidator and for "TYPE" property it does not
support DateTime.. it only supports Date..
Please advice.
is there any Control as such which provides me the both..

thanks

RSB

"Martin Marinov" <me********@mecrossroad.bg> wrote in message
news:ed*************@TK2MSFTNGP12.phx.gbl...
You can use CompareValidator by setting
Operator property to DataTypeCheck and Type property to DateTime, then for
the control set in the ControlToValidate the CompareValidator will get the
entered data and will try to convert it to the given type. if the data is
incorrect the CompareValidator will rise an error messsage.

When you use Operator=DataTypeCheck then the ControlToCompare is ignored

Regards
Martin

"RSB" <rs*****@hotmail.com> wrote in message
news:#H**************@TK2MSFTNGP09.phx.gbl...
Hi Every one ,
IS there any Date Time Control with .Net. All i want to read is the Date and Time in a Single Field like 12/31/2004 09:23:23AM.
if there is any then any examples for it. and if not then how to Validate
the Text field for above.

thanks
RSB


Nov 18 '05 #3
You are correct that the CompareValidator does not support Date + Time. You
will have to write a custom validator or consider an alternative design.
With a CustomValidator, on the server side you can use the DateTime
structure's ParseExact() method. If it throws an exception, it indicates a
bad entry.

May I suggest an alternative design? By combining both date and time into
one textbox, you are asking for the user to be very careful with formatting.
Users have to know both date and time patterns that you are expecting, plus
any separator rule. Often you assist users in entering dates with a popup
calendar. Time might have similar tools. If you allowed separate date and
time fields, you not only can add a popup calendar, but its also easier to
install client-side keystroke filtering to avoid illegal character entry.
Finally, these separate fields are easier to validate. You know that
CompareValidator can handle a date. You still would have to build a
validator for time.

My "Peter's Date Package" is a solution that includes datetextbox with popup
calendar, timeofdaytextbox, and validators for both. The two fields can
interact together. You can get and set one DateTime value and the software
interacts with both. http://www.peterblum.com/datecontrols/home.aspx.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"RSB" <rs*****@hotmail.com> wrote in message
news:O6*************@TK2MSFTNGP12.phx.gbl...
Hi Martin,
Thanks for he reply..
Now i was checking the CompareValidator and for "TYPE" property it does not support DateTime.. it only supports Date..
Please advice.
is there any Control as such which provides me the both..

thanks

RSB

"Martin Marinov" <me********@mecrossroad.bg> wrote in message
news:ed*************@TK2MSFTNGP12.phx.gbl...
You can use CompareValidator by setting
Operator property to DataTypeCheck and Type property to DateTime, then for
the control set in the ControlToValidate the CompareValidator will get the
entered data and will try to convert it to the given type. if the data is
incorrect the CompareValidator will rise an error messsage.

When you use Operator=DataTypeCheck then the ControlToCompare is ignored

Regards
Martin

"RSB" <rs*****@hotmail.com> wrote in message
news:#H**************@TK2MSFTNGP09.phx.gbl...
Hi Every one ,
IS there any Date Time Control with .Net. All i want to read is the Date

and
Time in a Single Field like 12/31/2004 09:23:23AM.
if there is any then any examples for it. and if not then how to Validate the Text field for above.

thanks
RSB


Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Hussein Patwa | last post by:
Hi there. I'm new to this group. I'm also partially sighted so navigating the web is sometimes quite difficult. I'm looking for a javascript date picker, you know the ones that travel sites...
3
by: Marauderz | last post by:
Hello guys, got a little question regarding the regional language settings . Anyway I got a Windows 2003 Server machine that was installed with the date format "dd/MM/yyyy" and location still...
1
by: billy | last post by:
Ok, here's the situation... I have a user control that contains two textboxes (one for a from date/time and one for a to date/time) and two image buttons. The user control itself is supposed to...
8
by: gumi | last post by:
Hi, I am looking for code for a alarm clock program that pops up a messege to be used as part of my VB.Net class project. Any help is very much appreciated. Thanks
6
by: Luvin lunch | last post by:
Hi, I'm new to access and am very wary of dates as I have limited experience in their manipulation and I know if they're not done properly things can turn ugly quickly. I would like to use a...
4
by: Michel Posseth [MCP] | last post by:
I have a problem with the date time picker validate event wich i believe is a bug How to reproduce : throw on a form a date time picker control and a textbox control select the validating...
1
by: Susan Bricker | last post by:
Greetings. I have a report (actually all of my reports in an MDB) that I want to date/time stamp at the bottom. Previously, I had used the builtin function of Now(). I thought that would give...
0
by: fredloh | last post by:
i have a tab control on my form. i then have several microsoft date and time picker control on the tab control. when i select a date on any of the date and time picker control, the result of the...
2
by: fniles | last post by:
I am using VB.NET 2005, and I am looking for a free calendar component that looks like "Control Panel" - "Date and Time". Does it exist ? Thank you
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.