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

Date format base in form of aspx

I have a form in ASP, where Date has to display in "dd/mm/yyyy" format. when I am saving that format into database its giving either error message or saving incorrect date. because sql used to insert dates in "dd/mm/yyyy" format.
say if date is 24 9 2007, in sql it will not save as "24/09/2007", it will be out of script range error and if date is 3 9 2007 , then sql will treat as 9 3 2007.
please find a solution for that.
Apr 10 '12 #1
1 1884
jhardman
3,406 Expert 2GB
The problem is in the database, not the webpage. Microsoft is a US company, and the standard US date format is mm/dd/yyyy so your MS SQL Server is interpreting the date as if you are putting the month first even if the aspx page understands the correct format. The best solution is to use a non-ambiguous date format like "12-Mar-2012" or "March 12, 2012" both of which will always be recognized by the database. Alternatively, if you have access to the db you can change its regionalization settings, I would give you 20:1 odds it is set to US regionalization.

By the way, this is the classic asp forum, not the aspx forum. Check the menus above, we have both.

Jared
Apr 10 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: Simon Brooke | last post by:
I'm investigating a bug a customer has reported in our database abstraction layer, and it's making me very unhappy. Brief summary: I have a database abstraction layer which is intended to...
6
by: Charles A. Lackman | last post by:
Hello, I an trying to get away from using a Date Time Picker and would like to know how to make a textbox format to a date, i.e. 6604 would be converted to 06/06/04 and if the user type in...
2
by: Ian | last post by:
I would like to have some validation on a date field. The date format is dd/mm which is used for our financial year end. I suppose I need also consider leap years. Please can you shed some light on...
1
by: jim | last post by:
Hi Ng I have got a form which uses to days date - the date is stored in a table when pressing af save button. The format in the code is :Format(Me.Form.Controls("CTLDato"), "mm/dd/yy") My...
1
by: Neo | last post by:
I use CompareValidator to validate a date. But CompareValidator can only one date format at one time. if the dateorder is "mdy", date format can only be mdy even if date format is ymd. But users...
2
by: ZagrebMike | last post by:
Hi, I want to create a simpleType that will constrain an element to be a date of the form dd/mm/yyyy. I have this at the moment, <xs:simpleType name="newDate"> <xs:restriction...
7
by: mewanalwis | last post by:
Dear Friends, I have a rather strange problem which invloves SQL server and ASP. The problem is this. I have an ASP application which use a SQL server. it saves date values with MM/dd/yyyy...
9
by: insomniux | last post by:
Hi, I am having a problem with formatting the default value of a date field. It has been discussed earlier in many topics, but still I cannot solve the problem. What's happening: I have various...
20
by: andreas | last post by:
When I copy a vb.net project using date formats from one PC with a windows date format f.e. dd/mm/yyyy to another PC having a format yy/mm/dd then I get errors. How can I change for a while in the...
7
by: Richiep | last post by:
I am trying to get a UK format date of dd/mm/yyyy. Why does the following subroutine not return a valid date in a web form? The date returned is #12:00:00 AM# but the date I entered into the...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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.