Please I really need help on this one… I have 2 Forms Form1 and Form2. In Form2 I Filter the DGV by Textboxchanged event
TBC Code
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
I return the filtered data by assigning the dv as the new DataSource for Form1 DGV.
This Code Works
Form1.TestingDataGridView1.DataSource = dv
Here in my question, in Form1 (with filtered data). I want to Edit the data in the DGV and then Update my MySql Table "testing". I am really confused about this cause I’ve never done this before. I usually Update my DGV and MySql Table by using the ff codes. How ever in this situation the ff codes doesn’t work.
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
I am really confused now, A little help would be really nice. Please and Thank You.
I’m finally able to update the data view now… Let me post my codes here for future reference just in case someone also needs help. this is a sample project so I didn’t go much into the codes and went directly to how I solved it.
Form1hasDatagridview(databound), 1 button "Form2"Codes for Form 1
Form2hasDGV (databound), 2Buttons, "Return", "Save", and a textbox