Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / General / September 2005

Tip: Looking for answers? Try searching our database.

Problem with LEAVE of a datetime field

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve - 07 Sep 2005 16:10 GMT
C#

I have a datetime field, when I leave this field I am trying to call some
validation on the date enered, namely that the date cant be ahead of today.

My validation checks the date entered against todays date.  If the user
types the following in:

07/9/2005

then this fails.  If she includes the extra zero:

07/09/2005, its fine.  

I have debugged and stepped into the Leave trigger and for some reason at
the top of the leave trigger the date is not set correctly the first time it
runs, but the second time it runs it is ok!  Its like the Leave trigger is
firing too early for me to validte the date on as it hasnt put in the extra
zero for me the first pass through.

Any one experienced this?  Is there a event that fires after leave?  If you
type in 07/9/2005 then tab out, it will correct itself and show as
07/09/2005, but this doesnt seem to occur until after the LEAVE trigger has
fired.

Thanks

Steve
Cor Ligthert [MVP] - 07 Sep 2005 16:46 GMT
Steve,

Be aware that the date you give can have more meanings in the different
culture settings no I assume it is the seventh of september. However am I
right when I assume that you have binded this textbox to a datatable.column
which has as type datetime?

The event to validate is of course validate, (as I assume that you mean with
trigger an event).

I see that nowhere in your text.

Cor

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.