Edward_jie

for you, my Hall of Frame

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
  90 随笔 :: 39 文章 :: 538 评论 :: 0 引用

c#写表结构的时候,在主键id的column()中一定要加入AutoSync = AutoSync.OnInsert, DbType = "INT NOT NULL Identity", CanBeNull = false, IsDbGenerated = true, IsPrimaryKey = true

     [Column]
        public double latitude
        {
            get { return _latitude; }
            set
            {
                if (_latitude != value)
                {
                    NotifyPropertyChanging("latitude");
                    _latitude = value;
                    NotifyPropertyChanged("latitude");
                }
            }
        }
        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        public event PropertyChangingEventHandler PropertyChanging;
        private void NotifyPropertyChanging(string propertyName)
        {
            if (PropertyChanging != null)
            {
                PropertyChanging(this, new PropertyChangingEventArgs(propertyName));
            }
        }

此类信息,而不能让它为空,不然,submitchanges毫无作用

posted on 2012-11-14 13:47 Edward_诺 阅读(...) 评论(...) 编辑 收藏