<bdo id='VknVF'></bdo><ul id='VknVF'></ul>
    <tfoot id='VknVF'></tfoot>

  • <legend id='VknVF'><style id='VknVF'><dir id='VknVF'><q id='VknVF'></q></dir></style></legend>

    <small id='VknVF'></small><noframes id='VknVF'>

      1. <i id='VknVF'><tr id='VknVF'><dt id='VknVF'><q id='VknVF'><span id='VknVF'><b id='VknVF'><form id='VknVF'><ins id='VknVF'></ins><ul id='VknVF'></ul><sub id='VknVF'></sub></form><legend id='VknVF'></legend><bdo id='VknVF'><pre id='VknVF'><center id='VknVF'></center></pre></bdo></b><th id='VknVF'></th></span></q></dt></tr></i><div id='VknVF'><tfoot id='VknVF'></tfoot><dl id='VknVF'><fieldset id='VknVF'></fieldset></dl></div>
      2. 从 DataGridView winforms 中的数据库中删除数据行?

        Delete data row from DB in DataGridView winforms?(从 DataGridView winforms 中的数据库中删除数据行?)
      3. <tfoot id='CwCR1'></tfoot>

          <small id='CwCR1'></small><noframes id='CwCR1'>

          <legend id='CwCR1'><style id='CwCR1'><dir id='CwCR1'><q id='CwCR1'></q></dir></style></legend>
            <tbody id='CwCR1'></tbody>

            <bdo id='CwCR1'></bdo><ul id='CwCR1'></ul>

                1. <i id='CwCR1'><tr id='CwCR1'><dt id='CwCR1'><q id='CwCR1'><span id='CwCR1'><b id='CwCR1'><form id='CwCR1'><ins id='CwCR1'></ins><ul id='CwCR1'></ul><sub id='CwCR1'></sub></form><legend id='CwCR1'></legend><bdo id='CwCR1'><pre id='CwCR1'><center id='CwCR1'></center></pre></bdo></b><th id='CwCR1'></th></span></q></dt></tr></i><div id='CwCR1'><tfoot id='CwCR1'></tfoot><dl id='CwCR1'><fieldset id='CwCR1'></fieldset></dl></div>
                2. 本文介绍了从 DataGridView winforms 中的数据库中删除数据行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想从数据库中删除该行数据,目前我可以通过点击删除按钮删除该行数据,但是数据库表没有更新,我该怎么做?

                  i want to delete the row of data from the database, currently i can delete the row of data by clicking on the delete button, but the database Table is not updated, how do i do so?

                  using System;
                  using System.Collections.Generic;
                  using System.ComponentModel;
                  using System.Data;
                  using System.Drawing;
                  using System.Linq;
                  using System.Text;
                  using System.Threading.Tasks;
                  using System.Windows.Forms;
                  
                  namespace project
                  {
                      public partial class frmTestPrint : Form
                      {
                          public frmTestPrint()
                          {
                              InitializeComponent();
                          }
                  
                          private void frmTestPrint_Load(object sender, EventArgs e)
                          {
                              // TODO: This line of code loads data into the 'usersDataSet1.Booking' table. You can move, or remove it, as needed.
                              this.bookingTableAdapter.Fill(this.usersDataSet1.Booking);
                  
                          }
                  
                  
                          private void btnDelete_Click(object sender, EventArgs e)
                          {
                              dataGridView1.Rows.RemoveAt(dataGridView1.CurrentRow.Index);
                          }
                      }
                  }
                  

                  推荐答案

                  这只是一次删除一个.我仍在处理多个删除操作.

                  This is only to delete one at a time. I am still working on multiple deletes.

                          if (MessageBox.Show("Sure you wanna delete?", "Warning", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
                          {
                              //get the index from the dataGridView
                              int rowIndex = table1DataGridView.CurrentCell.RowIndex;
                              //Remove from both the actual database & datagridview
                              table1BindingSource.RemoveAt(rowIndex);
                              //update table 1
                              this.table1TableAdapter.Update(this.maquinasDataSet.Table1);
                              //load table 1
                              this.table1TableAdapter.Fill(this.maquinasDataSet.Table1);
                          }
                  

                  这篇关于从 DataGridView winforms 中的数据库中删除数据行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Multicast delegate weird behavior in C#?(C# 中的多播委托奇怪行为?)
                  Parameter count mismatch with Invoke?(参数计数与调用不匹配?)
                  How to store delegates in a List(如何将代表存储在列表中)
                  How delegates work (in the background)?(代表如何工作(在后台)?)
                  C# Asynchronous call without EndInvoke?(没有 EndInvoke 的 C# 异步调用?)
                  Delegate.CreateDelegate() and generics: Error binding to target method(Delegate.CreateDelegate() 和泛型:错误绑定到目标方法)

                    <tbody id='PJ9PL'></tbody>

                3. <i id='PJ9PL'><tr id='PJ9PL'><dt id='PJ9PL'><q id='PJ9PL'><span id='PJ9PL'><b id='PJ9PL'><form id='PJ9PL'><ins id='PJ9PL'></ins><ul id='PJ9PL'></ul><sub id='PJ9PL'></sub></form><legend id='PJ9PL'></legend><bdo id='PJ9PL'><pre id='PJ9PL'><center id='PJ9PL'></center></pre></bdo></b><th id='PJ9PL'></th></span></q></dt></tr></i><div id='PJ9PL'><tfoot id='PJ9PL'></tfoot><dl id='PJ9PL'><fieldset id='PJ9PL'></fieldset></dl></div>

                  <small id='PJ9PL'></small><noframes id='PJ9PL'>

                  <tfoot id='PJ9PL'></tfoot><legend id='PJ9PL'><style id='PJ9PL'><dir id='PJ9PL'><q id='PJ9PL'></q></dir></style></legend>
                            <bdo id='PJ9PL'></bdo><ul id='PJ9PL'></ul>