This is a migrated thread and some comments may be shown as answers.

Problem with Date parameter and non-US localization.

5 Answers 200 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ole
Top achievements
Rank 1
Ole asked on 04 Nov 2010, 06:03 PM
Hi,

I have a report with a dateTime type report parameter, which is used in a where quairy in sqldatasource   . It works when I run it with with this

Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en-US");

 

 

Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");

 


in the report initializer.

How ever when running the report in my default culture (is-IS) the report fails with the message 

The conversion of nvarchar data type to datatime data type resulted in an out of range value.

This happens when the day of month is greater than 12 , so it thinks that the day is the month.

Is this a bug ?.

Best 

Ole 

5 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 09 Nov 2010, 02:16 PM
Hello Ole,

We are unable to reproduce the described error locally. Please check out the attached sample project. If you still experience difficulties we will highly appreciate if you open a support ticket and send us a sample project the exhibits the issue. Thus we will be able to debug it locally and advise you accordingly.

Sincerely yours,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
erwin
Top achievements
Rank 1
Veteran
Iron
answered on 21 Jan 2014, 08:28 AM
I have exactly the same problem - any news on this? (20013 Q3 latest internal build on winforms)
The report works when Regional Settings are set to English(US) but not when set to German(Switzerland)

The error message is not really helpful. It should at least provide some information about the context, for example that a report parameter is the source of the conversion error.
0
erwin
Top achievements
Rank 1
Veteran
Iron
answered on 21 Jan 2014, 08:48 AM
OK, found it after it became clear to me that the error message comes form SQL Server / SQL Server client not from Telerik Reporting itself.
The problem was that I declared the datasource parameters as string instead of datetime.
The nasty thing is that it works under US Regional settings (of course).

0
Hinata
Top achievements
Rank 1
answered on 23 Jan 2014, 04:34 PM
Thanks for sharing this erwin. I've been struggling with a similar issue lately.
0
erwin
Top achievements
Rank 1
Veteran
Iron
answered on 23 Jan 2014, 08:09 PM
Glad I could be of help!
Tags
General Discussions
Asked by
Ole
Top achievements
Rank 1
Answers by
Peter
Telerik team
erwin
Top achievements
Rank 1
Veteran
Iron
Hinata
Top achievements
Rank 1
Share this question
or