private void tBL_BookInfoBindingNavigatorSaveItem_Click(object sender, EventArgs e)
        {
            
           if (this.bookIDTextBox.Text.Length != 0)
          {
              MessageBox.Show(this, "BookInfo Add", "Save");
              tBL_BookInfoTableAdapter.Update(libraryDataSet, "TBL_BookInfo");
            }
           if (this.Validate())
            {
               this.tBL_BookInfoBindingSource.EndEdit();
               this.tBL_BookInfoTableAdapter.Update(this.libraryDataSet.TBL_BookInfo);
            }
}
数据库是libraryDataSet
连接的表是TBL_BookInfo
主键是BookID错误 1 “WindowsApplication1.LibraryDataSetTableAdapters.TBL_BookInfoTableAdapter”并不包含“Update”的定义 D:\application\WindowsApplication1\WindowsApplication1\Form1.cs 36 40 WindowsApplication1

解决方案 »

  1.   

    tBL_BookInfoTableAdapter这个的定义在哪里?
      

  2.   

     不好意思
    tBL_BookInfoTableAdapter.Update(libraryDataSet, "TBL_BookInfo"); 
    这行没有
      

  3.   

    private void tBL_BookInfoBindingNavigatorSaveItem_Click(object sender, EventArgs e) 
            { 
                
              if (this.bookIDTextBox.Text.Length != 0) 
              { 
                  MessageBox.Show(this, "BookInfo Add", "Save"); 
              } 
              if (this.Validate()) 
                { 
                  this.tBL_BookInfoBindingSource.EndEdit(); 
                  this.tBL_BookInfoTableAdapter.Update(this.libraryDataSet.TBL_BookInfo); 
                } 

    数据库是libraryDataSet 
    连接的表是TBL_BookInfo 
    主键是BookID 错误 1 “WindowsApplication1.LibraryDataSetTableAdapters.TBL_BookInfoTableAdapter”并不包含“Update”的定义 D:\application\WindowsApplication1\WindowsApplication1\Form1.cs 36 40 WindowsApplication1 
      

  4.   

    检查tBL_BookInfoTableAdapter类,该类不包含Update方法
      

  5.   

    tBL_BookInfoTableAdapter是什么?一个SqlDataAdapter?
      

  6.   

    tBL_BookInfoTableAdapter这个是你自定义的方法吗?还是控件的命名!说清楚点,错误是在这行。
    如果你要用datatable来更新数据库。那么该地方因该为SqlDataApdater
      

  7.   

    没有这个类, tBL_BookInfoTableAdapter是我连的数据源