MikaelEliasson / EntityFramework.Utilities

Provides extensions for EntityFramework that doesn't exist out of the box like delete and update by query and bulk inserts
442 stars 175 forks source link

Conversion from string " " to type 'Double' Error #64

Open a6datta opened 8 years ago

a6datta commented 8 years ago

Hi I am trying to update 4 columns. The data types are string. I am getting this error. I am using EF 6.1.3. First i tried with all columns I was getting similar error, then I tried with one but still without success.

System.InvalidCastException: Conversion from string " " to type 'Double' is not valid. ---> System.FormatException: Input string was not in a correct format. at Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String Value, NumberFormatInfo NumberFormat) at Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(String Value, NumberFormatInfo NumberFormat) --- End of inner exception stack trace --- at Microsoft.VisualBasic.CompilerServices.Conversions.ToDouble(String Value, NumberFormatInfo NumberFormat)

My Code: EFBatchOperation.[For](poentities, poentities.LondonA).UpdateAll(list, Function(x) x.ColumnsToUpdate(Function(c) c.FullA))

RubberChickenParadise commented 8 years ago

With out the entity code and the schema there is not much we could do to track down the error since its an issue converting a string with a single space to a Double.

If you can provide additional detail it may help tracking things down.