473,394 Members | 1,787 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,394 software developers and data experts.

Problem with LEAVE of a datetime field

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
Sep 7 '05 #1
1 1242
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
Sep 7 '05 #2

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

Similar topics

3
by: KathyB | last post by:
I'm trying to concatenate fields in SQL stored proc for use in text field in asp.net dropdownlist. I'm running into a problem when I try to use a DateTime field, but can't find the answer (so far)...
9
by: Paradigm | last post by:
I am using an Access2K front end to a MYSQL database. If I enter a new record in a continuous form the record appears as #deleted as soon as I move to a different record in the form until I requery...
1
by: Steve | last post by:
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...
1
by: DS | last post by:
I seem to have run into another strange anomaly with the monthCalendar control. I want to display 6 months at time with either the first half of the year (January-June) or the later half of the...
6
by: yoshitha | last post by:
hi db : sql server 2000 lan : C#.net(ASp.Net) in my database table there are 2 fileds of data type datatime. in field 1 i'm storing date in field 2 i'm storing time.
1
by: Grabi | last post by:
Hello. I'm using SQL2000, and I have a design problem. I know that every time I make a primary key, sql server makes it by default a clustered index. Since I have a large composite key in the table...
5
by: iulian.ilea | last post by:
Is correct to have a varchar field and insert dates of type dd/mm/yyyy into it? I choose this method because I have an application that runs on more than one server. So, if I used a datetime field...
4
by: =?Utf-8?B?QmFidU1hbg==?= | last post by:
Hi, I have a GridView and a SqlDataSource controls on a page. The SqlDataSource object uses stored procedures to do the CRUD operations. The DataSource has three columns one of which -...
2
JustRun
by: JustRun | last post by:
Hi, I have a problem with the (IsOnline) feature at my web site, Actually it works well as long as i'm doing activities even if i just navigate through the web site. The problem occure when i...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.