DNNDev.com Forums Minimize
: String was not recognized as a valid DateTime.
Last Post 26 May 2011 03:00 PM by Guillaume L. 6 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
rick
New Member
New Member
Posts:19
Avatar

--
28 Aug 2010 10:43 AM  
Hi everybody,

On a form I'm using a dateinput control like this:

<dateinput id="VergaderingDatum" DataField="VergaderingDatum" DataType="datetime" Format="d-M-yyyy HH:mm" Nullable="True" />

To display the current date time in this control I'm using

<SelectCommand CommandText="SELECT GETDATE() AS VergaderingDatum" />

The current date and time are correctly displayed when opening the form, but when I try to submit the form the following error shows:

: String was not recognized as a valid DateTime.

The strange thing is that when I clear the populated datetime field and typing exact the same date and time by hand, everything works fine.

Hope somebody can help me!

Regards Rick
rick
New Member
New Member
Posts:19
Avatar

--
28 Aug 2010 10:46 AM  
OK what I wrote was not correct, the error also pops up when typing the date time by hand

Any ideas?
rick
New Member
New Member
Posts:19
Avatar

--
31 Aug 2010 09:41 AM  
Does anybody have an idea what goes wrong?
Angus Beare
Advanced Member
Advanced Member
Posts:753
Avatar

--
02 Sep 2010 10:11 AM  
Hi

I am having the same problem with the data input control.

If you click 'contact' on the menu above you can raise it as a support request.

Gus
if the only tool you have is a hammer you tend to see every problem as a nail.. http://www.carawaydesign.com
DNNDev Admin
Senior Member
Senior Member
Posts:6314
Avatar

--
02 Sep 2010 04:21 PM  
Have you used the culture property on the date input?

Kelly
Power Your Website With XMod Pro
Buy XMod Pro Today
rick
New Member
New Member
Posts:19
Avatar

--
12 Sep 2010 01:05 PM  
No I did not used the culture property
Guillaume L
New Member
New Member
Posts:3
Avatar

--
26 May 2011 03:00 PM  
I have the same problem, here's a sample of my code. I want to validate if the CreatedDate is less or equal to the current date. The validation seems to be working fine, the error

"Error

: String was not recognized as a valid DateTime."

is shown when I click on add button.
The column CreatedDate is in format datetime in my database



<SelectCommand CommandText="SELECT GETDATE() AS CurrentDate" />
<SubmitCommand CommandText="INSERT INTO [ConcoursMarche] ([UserID], [CreatedDate], [NbrPas]) VALUES(@UserID, @CreatedDate, @NbrPas) " />

<DateInput Id="CreatedDate" DataField="CreatedDate" Format="yyyy-dd-MM" DataType="DateTime"></DateInput>
<CalendarImage ImageUrl="~/DesktopModules/XModPro/images/calendar.jpg" Style="margin-left:5px;" Target="CreatedDate" Format="yyyy-dd-MM"></CalendarImage>
<Validate Target="CreatedDate" CssClass="NormalRed xmp-validation" Type="required" Text="Requis" Message="Requis"></Validate>
<Validate Target="CreatedDate" CssClass="NormalRed xmp-validation" Type="compare" Text="Date aujourd'hui et précédente" Message="Date aujourd'hui et précédente" Operator="LessThanEqual" CompareTarget="diCurrentDate"></Validate>

<DateInput ID="diCurrentDate" DataField="CurrentDate" DataType="DateTime" Format="yyyy-dd-MM"/>
You are not authorized to post a reply.

Active Forums 4.1
spacer
dummy