'CarTrackr.Domain.Car' was not successfully updated

Jun 4, 2009 at 4:55 AM


I get the following error when running CarTrackr for the first time, and trying to add a car:

The model of type 'CarTrackr.Domain.Car' was not successfully updated.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The model of type 'CarTrackr.Domain.Car' was not successfully updated.

Source Error:

Line 142:            try
Line 143: {
Line 144: this.UpdateModel(car, new[] { "Make", "Model", "PurchasePrice", "LicensePlate", "FuelType", "Description" });
Line 145: CarRepository.Add(car);
Line 146:
Jun 4, 2009 at 6:49 AM

Can you try entering all numbers in en-US format? i.e. 4.23 liters

Jun 4, 2009 at 7:11 AM

Hi Maarten,

Yep, that solved the problem.  Truth is I kind of "copied" the values you got in "Asp.Net MVC Quickly" (starting with your wife's Peugot..lol).

Just now I did it again but just used "whole" numbers (not 100,000.00 for price of car or 4.5 for price of gas) and that worked.

Thanks a lot!  Lot to learn when I look at your code..ouch!

Mar 2, 2010 at 1:43 AM

Hi Maarten,

I also get the same error 

The model of type 'CarTrackr.Domain.Car' was not successfully updated

if I leave the Purchase Price input blank,  It seems that the validation rule of the system did not handle this kind of error.

How can I make the validation check for an empty input Purchase Price?


Thank you very much.