The format exception is most probable due to Double.Parse(bookPrice)
. Try to use invariant culture, like this:
Convert.ToDouble(bookPrice, CultureInfo.InvariantCulture);
Just to make sure, you can also use this:
double parsedBookPrice;
var isValidDouble = Double.TryParse(bookPrice, out parsedBookPrice);
If isValidDouble
is false, then the 45.00
format, is most probable invalid for the culture of your server.
CLICK HERE to find out more related problems solutions.