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 ?.
5 Answers, 1 is accepted
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,
the Telerik team
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.
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).