SetData: The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.


SYMPTOM

I get the following error message when the chart is run.

ErrorMessage: SetData: The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.

CAUSE

This is caused by the date format returned by the database not using the same culture formatting as the website.

SOLUTION

To solve this problem, the correct database culture must be specified.

[C#]

Chart.DatabaseCultureName = "en-GB";
// Or is using the DataEngine
myDataEngine.DatabaseCultureName = "en-GB";
 

 
[Visual Basic]

Chart.DatabaseCultureName = "en-GB"
' Or is using the DataEngine
myDataEngine.DatabaseCultureName = "en-GB"
 

For a list of culture names, please see this page.


Posted Wednesday, March 9, 2005 by Support
https://dotnetcharting.com/kb/KnowledgebaseArticle11066.aspx