rick
 New Member Posts:19

 |
| 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 Posts:19

 |
| 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 Posts:19

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

 |
| 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 Posts:6314

 |
| 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 Posts:19

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

 |
| 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"/> |
|
|
|
|