在Windows Phone中更新SQL Server CE中的NTEXT列

时间:2013-05-16 17:14:05

标签: windows-phone-7 sql-server-ce

我正在尝试更新定义但面临异常

  

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();
}

1 个答案:

答案 0 :(得分:0)

在Dictionary类中添加rowversion列:

 [Column(IsVersion = true)]
 private Binary _version;