【发布时间】:2011-01-06 20:36:12
【问题描述】:
所以我在数据库中有一个表,其中的列只是一个 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);
}
我在 catch 中得到了异常:"The property 'text' is part of the object's key information and cannot be modified."
当我查看表格时,我在“key”或“index”下看不到任何内容。所以这不是关键,我不明白为什么 C# 给我的信息不正确。 SQL Management Studio 中没有任何关于“文本”作为键或索引的内容。我该怎么办?
【问题讨论】:
标签: c# entity-framework-4