isenonder
skipping stones Posts:13
|
07-02-2012 03:03 AM |
|
hi. we are using date controls in our forms. but everytime we submit,
every other data is inserted to table but instead of the date, the form
inserts "error saving database" error.
we figured out what caused the problem:
our site's culture is Turkish. so the date format in our site is like this:
dd/mm/yyyy
but it tries to save the date to database like in english format: mm/dd/yyyy
so when we choose something like:
02/01/2012 it inserts fine.
but if we try inserting this date:
22/03/2012 it gives error.
can anyone suggest any solution for this?
|
|
|
|
|
Ryan Bakerink
river guide Posts:1900
|
07-02-2012 05:06 AM |
|
Hello isenonder, From my experience here is my recommendation: Save your date as the mm/dd/yyyy format. Anytime that you need to display this date value, you can use the TSQL Convert method to change the format of the date. Example: Select Convert(char(10), getDate(), 103) -- Format will be dd/mm/yyyy Let me know if you have any questions. Thanks, Ryan
|
|
|
|
|
isenonder
skipping stones Posts:13
|
07-02-2012 05:19 AM |
|
Thanks Ryan. I'll try to do that and present it to my client. i'll post results here. |
|
|
|
|
Ryan Bakerink
river guide Posts:1900
|
07-02-2012 05:26 AM |
|
Sounds great, and just for reference, I find myself using this resource when I can't remember specific date formats: http://anubhavg.wordpress.com/2009/...rver-2005/ I think you'll find it of use as well. I look forward to hearing your results. -Ryan |
|
|
|
|
isenonder
skipping stones Posts:13
|
07-02-2012 08:22 AM |
|
well we tried that. but there is one problem, we can't change the site's culture so in the date box, it has to be seen as Turkish format.
We changed the insert completion event as you said but no luck. the date is checked before the insert event and it's converted to "error saving date response" string.
my english may be bad so i'm sending you the sql event screenshot |
izto.jpg
|
|
|
|
Ryan Bakerink
river guide Posts:1900
|
07-06-2012 05:34 AM |
|
Hello, I would recommend making sure that the selected date from the datepicker is in mm/dd/yyyy or dd/mm/yyyy format. Then you can use the conversion method to format the date appropriately. I won't be able to write the full SQL statement for you for this falls out of our Standard Support. However there's several ways that you can handle a date to get it in your table column respectively. Dates and date formats are tricky pieces of information in SQL so there are tons of forum threads on the web on people that are having similar problems. The "Error Saving Date Response" text, does this come up only if a user doesn't select a date? I would also encourage taking a look at our demonstration 28, for this may open up your options: www.datasprings.com/formdemos Let me know if you have any questions. Thanks, Ryan
|
|
|
|
|
isenonder
skipping stones Posts:13
|
07-07-2012 01:11 AM |
|
Hi Ryan, thanks for the answer.
We will investigate it. i hope we can solve.
|
|
|
|
|
Ryan Bakerink
river guide Posts:1900
|
07-09-2012 06:27 AM |
|
Hello isenonder, Glad I could provide some direction for you. Please post back and let me know if you're able to get this resolved. If you're unable to get this resolved, you can always use our Premium Integration Services to have Data Springs involved with implementing this for you(this wouldn't take long). www.datasprings.com/premiumsupport Let me know if you have any questions. Thanks, Ryan
|
|
|
|
|