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
{
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
tBL_BookInfoTableAdapter.Update(libraryDataSet, "TBL_BookInfo");
这行没有
{
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
如果你要用datatable来更新数据库。那么该地方因该为SqlDataApdater