是这样我用vs2008 建立了一个form窗体 利用vs提供的数据源操作 将表添到了窗体上,现在调试时报错 保存按钮代码
private void customersBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
this.Validate();
this.customersBindingSource.EndEdit();
this.tableAdapterManager.UpdateAll(this.testDataSet); //发生错误行
}错误是Update requires a valid UpdateCommand when passed DataRow collection with modified rows.
private void customersBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
this.Validate();
this.customersBindingSource.EndEdit();
this.tableAdapterManager.UpdateAll(this.testDataSet); //发生错误行
}错误是Update requires a valid UpdateCommand when passed DataRow collection with modified rows.
解决方案 »
- 求类似www.vafox.com www.taoxie.cn的源码
- INSERT 语句与 COLUMN FOREIGN KEY 约束 'FK_NewsInfo_NewsTypeInfo' 冲突。
- 【求助】关于“覆盖Object.Equals()”和“隐式类型转换”的问题,谢谢!
- dataSet 更新数据库,但数据库并没有更新
- 网络驱动器不能当本地硬盘用吗?
- 能导出3dsMax的灯光(光照)数据吗?
- 怎么样能使当前的年,月,日的值,分别负给3个String的变量!!
- 各位大哥,Excel里怎样直接加载xml啊?不好意思,分太少了(只有10分了),请大家一定要帮下忙.
- VS C# 2010 chart控件问题
- 接口实现问题
- waveInGetDevCaps
- 请会java的把这两行java代码转化为C#的.谢谢!
好像是说无效的操作方法对列的操作
我们帮忙调试下看看就知道了。
其中的sql语句
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;namespace Data
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void customerBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
this.Validate();
this.customerBindingSource.EndEdit();
this.tableAdapterManager.UpdateAll(this.testDataSet); } private void Form1_Load(object sender, EventArgs e)
{
// TODO: 这行代码将数据加载到表“testDataSet.customer”中。您可以根据需要移动或移除它。
this.customerTableAdapter.Fill(this.testDataSet.customer); }
}
}
这是保存按钮上的代码