Question

im using subsonic 3.0.0.3 activerecord and everything is fine and i get no error but when i update a database, it never seems to actually happen, can anyone spot anything i am missing here?! ta

code:

var myquote = createNewQuote();

var gross = 36.00;

myquote.totalcost = gross;  // set the new value in my model

UpdateModel(myquote); // update the model, something to do with dirty columns??

if(ModelState.IsValid) // check to make sure i have no errors in my model after changing it
            myquote.Update(); // command that is supposed to update the database????

i have put a break point on UpdateModel and looked into the model and the value is in the model as directed, i get no error and modelstate is valid too, but when i look into the database the totalcost has not actually been changed for that record????

i have also tried .Save() but this too does not seem to change anything ?????

am a little puzzled

Was it helpful?

Solution

not sure if this fixes your problem but I know there a few bugs fixed here that helped me out with a few isssues I was having.

Goto: http://github.com/subsonic/SubSonic-3.0/tree/master

OTHER TIPS

There was a bug introduced in 3.0.0.1 that I removed quickly with 3.0.0.2 that inhibited updates in certain scenarios with ActiveRecord. Our current version is 3.0.0.3 - you should update.

Subsonic is not yet stable.. You will end up wasting your time googling around.. (peace!)

to solve your problem try this.

myquote.SetIsLoaded(true);

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top