相关疑难解决方法(0)

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

所以我在数据库中有一个表,其中一列只是一个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中没有任何内容说"文本"是关键字或索引.我该怎么办?

c# entity-framework-4

8
推荐指数
1
解决办法
2万
查看次数

标签 统计

c# ×1

entity-framework-4 ×1