Bindingsource 中的新记录
我有一个带有 datagridview 的表单和一些绑定到绑定源的文本框。表单上有一个“新建”按钮和“保存”按钮。我希望用户
- 单击“新建”按钮,这将导致网格转到新行并且文本框变为空白(因为它是新行)。
- 接下来,用户将在文本框中输入数据以创建新记录
- 最后单击“保存”按钮保存记录并更新到数据库
我不知道“添加”和“保存”按钮的代码。
有人可以帮助我吗?
I have a form with a datagridview and some text boxes which is bind to the bindingsource. There are an New button and Save button on the form. I wanted the user to
- click the New button that will cause grid to go to a new row and the textboxes to go blank (since it is a new row).
- Next, the user will enter data into the textboxes to for a new record
- Finally click Save button to save the record and update to database
I have no idea on the code for the Add and Save buttons.
Can anyone help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
本教程将详细概述您想要做什么。
http://www.codeproject.com/Articles/24656/A -详细数据绑定教程
This tutorial will give you a detailed overview of what your wanting to do.
http://www.codeproject.com/Articles/24656/A-Detailed-Data-Binding-Tutorial