CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 [Solved] field dateformat with hours and minutes ???

Print topic Send  topic

Author Message
bogdantc

Posts: 36
Posted: 06/02/2008, 1:27 AM

i am using C# 2.0 and CCS 3.2 .. i have a textbox where i insert a date using www.dynarch.com/projects/calendar ... i was not giving any format in the field format property from CCS so the default is ShortDate ...

everything worked perfect with just date (mm/dd/yyyy) but when i have added hours and minutes and tried to change date formats to find something appropriate, at every try i receive the messages bellow depending on which format I choose.

The value in field myDate is not valid. Use the following format: ShortDate.,The value in field myDate is required.

The value in field myDate is not valid. Use the following format: GeneralDate.,The value in field myDate is required.

any help? any suggestion? without a proper debugging option i am really stuck in this and have no idea what try ...
_________________
Able was I ere I saw Elba
View profile  Send private message
wkempees


Posts: 1679
Posted: 06/02/2008, 4:32 AM

Would love to help, give suggestions.
Datefield management is hard at times but mostly basic if you analyze your project and your problem in the right fashion.

Fisrt of all changing from date to datetime:
What database are you using (CCS3.2), have you made sure your date field will be a datetime field?
What basic settings do you use in Project setting->Connections for both design and server side connections? These have to be correct and reflect the database settings!

Then, if a field needs to overrule the basic settings, the properties of the field allow you to set both field dateformat as well as database format different from the Connection settings.

Last but not least, what format does the calendar supply it's data.
Get all this info right, set it right and all will be well.

Cannot assist you easily on the C# front, but as this post will bump your question to the top of the forum, I am sure others will oblige.

Walter


_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
bogdantc

Posts: 36
Posted: 06/02/2008, 5:41 AM

OK what I have to do is to make an application that runs with English and German date formats to accept hours and minutes. After repeated testing for English I have managed to get to the following error using the format mm/dd/yyyy h:nn AM/PM

Quote :
Unable to set value for the Date field: Unable to parse the 'Value' argument or cast it to the System.DateTime type

this might mean that the database (SQL Server 2005) is not accepting or can not convert the date format to a format that it's recognizing BUT unfortunately there is a little other problem ... i have used Profiler and no Insert command is getting to the database so it must be and additional check that CCS is doing ...

Quote :
06/02/2008 03:30 PM
02.06.2008 03:30 PM

the above values should act the same meaning 2nd of June 2008 03:30 PM ...
_________________
Able was I ere I saw Elba
View profile  Send private message
bogdantc

Posts: 36
Posted: 06/04/2008, 12:40 AM

item.myDate.SetValue(item.myDate.GetFormattedValue(""), "yyyy-MM-dd HH:mm:ss");

this is the code that is causing the error ... any ideas?
_________________
Able was I ere I saw Elba
View profile  Send private message
bogdantc

Posts: 36
Posted: 06/04/2008, 4:01 AM

ok I found the solution eventually after a lot of time spent for this issue ... too much imho ...
item.myDate.SetValue(item.myDate.GetFormattedValue(""), "G");

_________________
Able was I ere I saw Elba
View profile  Send private message
wkempees


Posts: 1679
Posted: 06/04/2008, 3:36 PM

Please change title to [Solved]

Walter

_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.