We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Object cannot be cast from DBNull to other types.

I've recently upgraded from version to and started to get this exception when setting DataTable (containing DBNull values) as chart items source. In previous version it worked fine.

Object cannot be cast from DBNull to other types.
   at System.DBNull.System.IConvertible.ToDouble(IFormatProvider provider)
   at Syncfusion.UI.Xaml.Charts.ChartSeriesBase.GenerateDataTablePoints(String[] yPaths, IList`1[] yLists)
   at Syncfusion.UI.Xaml.Charts.ChartSeriesBase.GeneratePoints(String[] yPaths, IList`1[] yValueLists)
   at Syncfusion.UI.Xaml.Charts.XyDataSeries.OnDataSourceChanged(IEnumerable oldValue, IEnumerable newValue)
   at Syncfusion.UI.Xaml.Charts.ChartSeriesBase.OnDataSourceChanged(DependencyPropertyChangedEventArgs args)
   at Syncfusion.UI.Xaml.Charts.ChartSeriesBase.OnDataSourceChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)

Thank you for your help

1 Reply

HM Hemalatha Marikumar Syncfusion Team January 9, 2020 08:29 AM

Hi Ondrej, 
Greetings from Syncfusion. 
We would like to let you know that we were able to reproduce the reported issue and fixed the same. Please find the patch from below link  
Advanced approach – use only if you have specific needs and can directly replace existing assemblies for your build environment

Please find the patch assemblies alone from below location:  

Assembly Version: 
Please note that we have created this patch for version specifically to resolve the following issue reported in this incident. If you have received other patches for the same version for other products, please apply all patches in the order received 
To Clear the cache: 
Follow the below link to clear cache,   
For Mac   
• ~/.local/share/NuGet/Cache   
• ~/.nuget/package   

The fix will be included in our weekly Nuget release which is expected to be rolled out on 14th January 2020.
Notes: We were unable to reproduce the issue which is reported in the forum F150484, but we included some of the possible fix in this custom patch. Please check with that patch and If you faced same issue after updating with this patch please provide us more information. 
Hemalatha M. 

Live Chat Icon For mobile
Up arrow icon