aarontham
asked on
VB.net 2008 update dataset to MySql
i populate an datagridview with below code. then user will do some edit on the datagridview . after the edit i need an button to update back the data to MySql. pls provide code.
Dim cnString3 As String = My.Settings.DataCon
Dim strQuery3 As String = "SELECT * From t_user"
Using adapter As New MySqlDataAdapter(strQuery3, cnString3)
Dim myDataSet As New DataTable()
Try
adapter.Fill(myDataSet)
Catch exError As Exception
MessageBox.Show(exError.Message, _
Me.Text, _
MessageBoxButtons.OK, _
MessageBoxIcon.Error)
Exit Sub
End Try
'FILL DATAGRIBVIEW FROM DATABASE
Me.DataGridView1.DataSource = myDataSet
End Using
ASKER
i prefer to use adaptor.Update. but i can't get it work. Pls provide code which use button to fire the save event.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window