string new Encrypted Password; string new Password Salt; Sched Util.md5Hash(password, ref new Encrypted Password, ref new Password Salt); user. Password Salt = new Password Salt; @Aliester 1 and 1 to Ved as well.
However I accepted another answer because it actually was dealing with the under lying problem which is that originally I tried to pass the public properties to my method but I got a compiler error because you can't pass properties by reference apparently.
In this situation, LINQ ignores the update and does not change the data.
I’m not sure how the PK was lost from the class in the first place, but deleting and re-adding the table to the LINQ schema solved the problem – After doing this the PK was in place.
If you use C# and Linq2Sql, you can list the field which would be truncated: First create helper class: Just want to contribute with additional information: I had the same issue and it was because of the field wasn't big enough for the incoming data and this thred helped me to solve it (the top answer clarifies it all).Having checked my connection string to ensure I was connecting to the right database, and also checking that I was viewing the same database in SQL Server management studio when checking the value, some research was in order.Turns out the LINQ2SQL class was missing the primary key (even though the SQL table had one set).My only outstanding question with this: If I’m calling ‘Submit Changes’ clearly I’m wanting to update some values and LINQ knows what classes (Tables) I’m working with at the time – So why is there no check to ensure that a PK is in place – Which should then result in an exception being thrown…answers on a comment please !I am having difficulties UPDATING the databes via LINQ to SQL, inserting a new record works fine.The code correctly inserts a new row and adds a primary key, the issue I am having is when I go to update (chnage a value that is already in the database) that same row the database is not updating, it is the else part of the code that does not work correctly.