views:

945

answers:

3

I have got a field with data type int? price and allow null, when I set

book.price = null;

and update, it is not saved and does not throw any exceptions, when I change value # null, it is ok. I want set it null, plz help.

A: 

Hi,

Make sure the field is nullable in the database and is reflected so in the dbml. Regenerate the dbml for the table just to be sure. (Drop tabel from dbml and add again)

All I can say is it works for us so this is very strange.

Kind regards,

SharePoint Newbie
A: 

I am not suer I understand the question, this part is unclear: "when I change value # null, it is ok"

Did you make sure to call

db.SaveChanges();

(where [db] is the name of your Entites object) It is a simple mistake that I make often :P

naspinski
it does not seem that the problem was that. because when the value was changed, i guess what value # null is such as 100, than it works as expected. problem must be something else.
yapiskan
A: 

Same problem here!!!! Seems like a bug to me~~