关于vs2010里面 DataGridView数据修改,但是保存不了的问题,求高手

wh606 2012-05-25 10:35:11
我做了一个winform的程序,在权限管理模块里面,用DataGridView + BindingSource + DataSet来做的,但是没法更新数据库,求高手指点!
具体做法:
添加DataGridView控件,给它选择数据源userBindingSource,它会自动生成一个userTableAdapter和LAMOSTSDSSDataSet控件(LAMOSTSDSS为数据库名,user为用户表)。
在保存按钮,代码是这么写的:
this.Validate();
this.dataGridView1.EndEdit();
this.userBindingSource.EndEdit();
this.userBindingSource.ResetBindings(false);
this.userTableAdapter.Update(this.LAMOSTSDSSDataSet.user);
求高手指点!
...全文
61 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

111,126

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧