C# DataGridView的问题
private void btnSave_Click(object sender, EventArgs e)
{
DialogResult result;
result = MessageBox.Show("确定","操作提示",MessageBoxButtons.OKCancel,MessageBoxIcon.Question);
if (result == DialogResult.OK)
{
this.productsTableAdapter.Update(this.superMarketDataSet);
}
}
新手。C#2005软件
很简单的一个练习的例子,按下按钮就应该保存。现在的现象是如果在下面新建一行能够保存。如果是在原数据修改后家就会在【this.productsTableAdapter.Update(this.superMarketDataSet);】这一行出现中断。
书上写:因为程序自动生成DataSet和DataAdapter,所以不需要手动创建SqlCommandBuilder
没看懂意思。。。
出的问题是:点击保存按钮时出错
该问题如何解决
this.productsTableAdapter.Update(this.superMarketDataSet);
这句是什么意思。。。看不懂,你到底要实现什么功能呀,是想吧dataGridView的内容保存到哪里呀?
错误内容:当传递具有已修改行的 DataRow 集合时,更新要求有效的 UpdateCommand。
design生成的代码如下。
private System.Windows.Forms.DataGridView dataGridView1;
相关问答:
最近在做个网上商城,购物车模块,没有做过,麻烦各位帮忙说下大致说下思路,能发一份源码更好。小弟先谢过各位了;
QQ:413763818;
eamil:swebook@126.com
网上一大堆!
www.51aspx.com
去下 ......
21cn的邮箱,在outlook配置后可以正常收发邮件,可是我写在C#中就不行,换成其它邮箱,163很早注册的。可以发送。查了很久,没有找到原因,请高手帮忙解答。。。小弟,谢了。。代码如下:
private void SendMail ......
可能因为工作的原因 接触数据库这块比较少,之前都是做程序这块,数据库这块都有专门的人来做 分工都很明细 所以对数据库这一块完全不了解。前段时间 去面试了几家公司 几乎都是在数据库这块挂掉的 连个简单的SQ ......
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using Syst ......