属性"text"是对象的关键信息的一部分,无法修改

Dex*_*ter 8 c# entity-framework-4

所以我在数据库中有一个表,其中一列只是一个nvarchar(800).

当我尝试做的时候:

try
{
    UserTable = (from x in entities.userTable where x.uID == uID select x).Single();
    UserTable.DateCreated = DateTime.Now;
    UserTable.text= newText;
    Update(UserTable);
}
Run Code Online (Sandbox Code Playgroud)

我在catch中得到了异常: "The property 'text' is part of the object's key information and cannot be modified."

当我查看表格时,我在"密钥"或"索引"下看不到任何内容.所以它不是关键,我不明白为什么C#给我不正确的信息.SQL Management Studio中没有任何内容说"文本"是关键字或索引.我该怎么办?

luk*_*fer 16

桌子上有PK吗?如果不是,EF使用所有字段/列作为"密钥信息"的一部分.