Bindingsource 中的新记录

发布于 2025-01-08 10:34:43 字数 237 浏览 1 评论 0原文

我有一个带有 datagridview 的表单和一些绑定到绑定源的文本框。表单上有一个“新建”按钮和“保存”按钮。我希望用户

  1. 单击“新建”按钮,这将导致网格转到新行并且文本框变为空白(因为它是新行)。
  2. 接下来,用户将在文本框中输入数据以创建新记录
  3. 最后单击“保存”按钮保存记录并更新到数据库

我不知道“添加”和“保存”按钮的代码。

有人可以帮助我吗?

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

  1. 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).
  2. Next, the user will enter data into the textboxes to for a new record
  3. 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦太阳 2025-01-15 10:34:43

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文