Answer the question
In order to leave comments, you need to log in
How to save data from DataGridView1 back to database (connect via Odbc)?
Connect data to control
Dim MyConString As String = StringConnectToBDMySQL(driver_mysql, options_server, options_database, options_user, options_password, "3")
' Производим попытку соединения
Try
adapter = New OdbcDataAdapter(strSQL, MyConString)
adapter.MissingMappingAction = MissingMappingAction.Passthrough
adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey
Catch ex As Exception
MsgBox("connection: " & ex.Message)
'Return False
End Try
Dim DataSet1 As DataSet = New DataSet
Try
adapter.Fill(DataSet1, "table")
Catch ex As Exception
MsgBox("fill: " & ex.Message)
'Return False
End Try
Dim Workview As DataView = DataSet1.Tables("table").DefaultView
DataGridView1.DataSource = Workview
Answer the question
In order to leave comments, you need to log in
something like: adapter.update()There is: DbDataAdapter.Update Method .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question