0

我正在尝试更新定义但遇到异常

SQL Server 不提供 NETXT、XML、Image 等的比较

不知道怎么处理。

我的表结构如下所示:

[Table]
public class Dictionary
{
    private string _definition;

    [Column(IsPrimaryKey = true)]
    public string Word
    {
        get;
        set;
    }

    [Column(CanBeNull = false, Storage="_definition", DbType="NTEXT")]
    public string Definition
    {
        get { return this._definition; }
        set { this._definition = value; }
    }
}

这是我的更新代码

using (DictionaryDataContext d8db = new DictionaryDataContext(strConnectionString))
{
            IQueryable<Dictionary> DicQuery = from word in d8db.tb_Dictionary where word.Word == w.Word select word;
            Dictionary wordShow = DicQuery.FirstOrDefault();
            wordShow.Definition = "some string";
            d8db.SubmitChanges();
}
4

1 回答 1

0

在 Dictionary 类中添加 rowversion 列:

 [Column(IsVersion = true)]
 private Binary _version;
于 2013-05-16T18:20:03.407 回答