Problems on SubmitChanges() in Linq?
-
Hello everyone: Now i am programing to update data with linq. i use dbcontext.submitchanges() to submit the changes to database.However, i find my table is not changed at all after that. Definately, there is no exception in the process of update, is there anyone know why? anything will be appreciated, thanX in advance~
-
Hello everyone: Now i am programing to update data with linq. i use dbcontext.submitchanges() to submit the changes to database.However, i find my table is not changed at all after that. Definately, there is no exception in the process of update, is there anyone know why? anything will be appreciated, thanX in advance~
We need more info to help - ideally sample of the code that is failing.
'Howard
-
We need more info to help - ideally sample of the code that is failing.
'Howard
here is the code: TestDataContext test= new TestDataContext(); var result= from person in test.Stuffs //Stuffs is a table where person.name==strUser; //strUser is a string passed in select person; foreach (var Item in result) { Item.value=777; } test.SubmitChanges();
-
here is the code: TestDataContext test= new TestDataContext(); var result= from person in test.Stuffs //Stuffs is a table where person.name==strUser; //strUser is a string passed in select person; foreach (var Item in result) { Item.value=777; } test.SubmitChanges();
Finally, i get the reason~ :laugh: I havnt set the primary key in my table,lol anyway, thank u all who have cared my msg~:rose: