can you explain why the input strings were not in a correct format when instanciating my object?

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.

Leave a Comment

Your email address will not be published.

Scroll to Top