请确实需要帮助解决此问题...我有2个表单Form1
和Form2
。在Form2
我过滤DGV
通过Textboxchanged event
筛选表单2中的datagridview并将筛选后的数据返回到Form1中的datagridview中
TBC代码
Dim dvSection As DataView
Dim tableAdapter As New testDataSetTableAdapters.testingTableAdapter
Dim ds As New testDataSet
dv.Table = TestDataSet.testing
dv.RowFilter = "CONVERT(TransactionID, System.String) LIKE '%" & TextBox1.Text & "%'"
TestingDataGridView.DataSource = dv
我通过为Form1 DGV
新DataSource
分配dv
返回过滤后的数据。
此代码的工作
Form1.TestingDataGridView1.DataSource = dv
在这里,在我的问题,在Form1
(用过滤后的数据)。我想Edit
data
在DGV
然后Update
我的MySql Table "testing"
。我真的很困惑这个原因,我从来没有这样做过。我通常使用ff代码Update
my DGV
和MySql Table
。在这种情况下,ff代码是行不通的。
If MsgBox("Save Changes Made in this Cell?", MsgBoxStyle.YesNo, MsgBoxStyle.Exclamation) = DialogResult.Yes Then
Me.Validate()
Me.TestingBindingSource.EndEdit()
Me.TestingTableAdapter.Update(Me.TestDataSet.testing)
End If
我真的很困惑,现在有点帮助会很好。谢谢,麻烦您了。