Reputation: 4747
I am trying to do the equivalent of an SQL UPDATE with C# statements in linqpad but the data doesn't change and I'm not sure to even debug it further to figure out why. The User table is pretty standard with just a string to store Sid.
var usersWithSid = from u in Users where u.Sid != null select u;
foreach(var u in usersWithSid) {
u.Sid = "S-1-5-21-3812666658-2998621725-2245962016-6618";
}
SubmitChanges();
usersWithSid.Dump();
Most of the examples I have found seem to only update one record at a time. Why doesn't this work?
Upvotes: 8
Views: 5475
Reputation: 13940
Do you have a primary key defined on the table? The updates will silently fail if you don't.
Upvotes: 6