InstantASP Community Forums
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        


Cast from string to date Expand / Collapse
Author
Message
Posted 27/05/2005 13:12:12
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 06/06/2005 06:01:11
Posts: 3, Visits: 12
Can someone help me out:

Im getting

[font=System]
Server Error in '/instantforum34' Application.
Cast from string "Mai 27 2005 10:27AM" to type 'Date' is not valid.

Exception Details: System.InvalidCastException: Cast from string "Mai 27 2005 10:27AM" to type 'Date' is not valid.


[InvalidCastException: Cast from string "Mai 27 2005 10:27AM" to type 'Date' is not valid.]
Microsoft.VisualBasic.CompilerServices.DateType.FromString(String Value, CultureInfo culture) +160
Microsoft.VisualBasic.CompilerServices.DateType.FromString(String Value) +53
InstantASP.InstantForum.Logic.GetForumIcon(DateTime LastVisit, Int32 intForumID, Boolean AllowPosts, Boolean
...

[/font]

When trying to open forums default.aspx

Is it because my installed framework "speaks" german and has a different expectation of how a date-string should come like? I really do not have any idea...



hallo
Post #6931
Posted 27/05/2005 14:21:08


Support Supremo

Support SupremoSupport SupremoSupport SupremoSupport SupremoSupport SupremoSupport SupremoSupport SupremoSupport Supremo

Group: Customers
Last Login: 13/11/2008 12:44:07
Posts: 568, Visits: 2,507
This happens when we run stored procedures that contain a convert function and your regional settings are not compatible with the convert function parameter.
For example:  if_sp_ShowMiscellaneousTopics, In this stored procedure, we have the following in the middle the convert function:   Convert(varchar, DATEADD(d,-14,GETDATE()), 101).  The value 101 means that we are using USA date format standard
You should change the value 101 to 0 to be the default standard in the if_sp_ShowMiscellaneousTopics and if_sp_GetForumRSSFeed stored procedures. they are using the convert function with datetime datatype as a parameter."
Post #6940
Posted 27/05/2005 16:58:36
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 06/06/2005 06:01:11
Posts: 3, Visits: 12
are you sure that this is the problrm?
I changed the 101 to 0 but all I get is more pain.

I changed a few 101s to 0 at:
if_sp_ShowMiscellaneousTopics

and another at:
if_sp_GetForumRSSFeed

But the error is still the same.

Any further ideas or corrections?



hallo
Post #6942
Posted 28/05/2005 20:31:01
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Customers
Last Login: 14/10/2005 18:52:24
Posts: 93, Visits: 173
I might be offbase here, but I noticed that it states "Mai" not "May". Am I correct to assume you have none-english culture on the IIS server? Does it match that on the SQL Server?

I'm just guessing here, maybe SQL is not understanding "Mai"?

Post #6958
Posted 30/05/2005 12:45:31


Support Supremo

Support SupremoSupport SupremoSupport SupremoSupport SupremoSupport SupremoSupport SupremoSupport SupremoSupport Supremo

Group: Customers
Last Login: 13/11/2008 12:44:07
Posts: 568, Visits: 2,507
tillm4nn (5/27/2005)
are you sure that this is the problrm?
I changed the 101 to 0 but all I get is more pain.

I changed a few 101s to 0 at:
if_sp_ShowMiscellaneousTopics

and another at:
if_sp_GetForumRSSFeed

But the error is still the same.

Any further ideas or corrections?

Dear Tillmann,

I've fixed the problem adding the globalization tag below in the web.config file:

<globalization culture="de-DE" uiCulture="de-DE" />

Post #6970
« Prev Topic | Next Topic »

Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ryan Healey, Mark Christianson, Bare, James Trott

Permissions Expand / Collapse

All times are GMT, Time now is 3:38am

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.109. 8 queries. Compression Disabled.
Home | Products | Purchase | Support | Company | Contact Us
Privacy Statement | © 1999-2007 InstantASP Limited. All Rights Reserved.