So I have a table in the database, with a column that is simply an nvarchar(800).
When I try to do:
try
{
UserTable = (from x in entities.userTable where x.uID == uID select x).Single();
UserTable.DateCreated = DateTime.Now;
UserTable.text= newText;
Update(UserTable);
}
I get the exception in catch: "The property 'text' is part of the object's key information and cannot be modified."
When I look into the table, I don't see anything under "key" or "index". So it's not a key, I don't understand why C# is giving me incorrect information. Nothing in SQL Management Studio says anything about "text" being a key or index. What do I do?
Is there a PK on the table at all? If not, EF uses all of the fields/columns as part of the "key information."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With