2011-12-20 52 views
3

在項目中,我的用戶SQL CE,我有表:更新在SQL CE窗口電話7

[Table] 
public class Article : INotifyPropertyChanged, INotifyPropertyChanging 
{ 

    // Define _cid: private field, public property, and database column. 
    private int _aid; 

    [Column(DbType = "INT NOT NULL IDENTITY", IsDbGenerated = true, IsPrimaryKey = true)] 
    public int aid 
    { 
     get { return _aid; } 
     set 
     { 
      NotifyPropertyChanging("aid"); 
      _aid = value; 
      NotifyPropertyChanged("aid"); 
     } 
    } 

    // Define nameColor name: private field, public property, and database column. 
    private int _rid; 

    [Column] 
    public int rid 
    { 
     get { return _rid; } 
     set 
     { 
      NotifyPropertyChanging("rid"); 
      _rid = value; 
      NotifyPropertyChanged("rid"); 
     } 
    } 


    private string _title; 
    [Column] 
    public string title 
    { 
     get { return _title; } 
     set 
     { 
      NotifyPropertyChanging("title"); 
      _title = value; 
      NotifyPropertyChanged("title"); 
     } 
    } 


    private string _thumnail; 
    [Column] 
    public string thumnail 
    { 
     get { return _thumnail; } 
     set 
     { 
      NotifyPropertyChanging("thumnail"); 
      _thumnail = value; 
      NotifyPropertyChanged("thumnail"); 
     } 
    } 

    private string _DesScription; 
    [Column(DbType = "NTEXT")] 
    public string DesScription 
    { 
     get { return _DesScription; } 
     set 
     { 
      NotifyPropertyChanging("DesScription"); 
      _DesScription = value; 
      NotifyPropertyChanged("DesScription"); 
     } 
    } 

    private int _orderID; 
    [Column] 
    public int orderID 
    { 
     get { return _orderID; } 
     set 
     { 
      NotifyPropertyChanging("orderID"); 
      _orderID = value; 
      NotifyPropertyChanged("orderID"); 
     } 
    } 

    private string _pubDate; 
    [Column] 
    public string pubDate 
    { 
     get { return _pubDate; } 
     set 
     { 
      NotifyPropertyChanging("pubDate"); 
      _pubDate = value; 
      NotifyPropertyChanged("pubDate"); 
     } 
    } 

    private string _linkURL; 
    [Column] 
    public string linkURL 
    { 
     get { return _linkURL; } 
     set 
     { 
      NotifyPropertyChanging("linkURL"); 
      _linkURL = value; 
      NotifyPropertyChanged("linkURL"); 
     } 
    } 
    #region INotifyPropertyChanged Members 

    public event PropertyChangedEventHandler PropertyChanged; 

    // Used to notify that a property changed 
    private void NotifyPropertyChanged(string propertyName) 
    { 
     if (PropertyChanged != null) 
     { 
      PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); 
     } 
    } 

    #endregion 

    #region INotifyPropertyChanging Members 

    public event PropertyChangingEventHandler PropertyChanging; 

    // Used to notify that a property is about to change 
    private void NotifyPropertyChanging(string propertyName) 
    { 
     if (PropertyChanging != null) 
     { 
      PropertyChanging(this, new PropertyChangingEventArgs(propertyName)); 
     } 
    } 

    #endregion 
} 

當我更新科拉姆略圖,我有誤差修改:

SQL Server不處理的比較NTEXT,文本,XML,或圖像數據類型的

因爲特殊字符到數據庫插入序列trogn我應該用BbType = 「NTEXT」

請幫幫我!

回答