update / add row in datatable
Hi,
I am trying to update and/or add rows to a datable, and although the records are changed in the datatable they are not updated in the database. I can update using sql commands, but I would rather update a row directly and then update the database. I had a look at Dan Carr's post which was a similar problem but I can't seem to get it to help me.
Thanks in advance.
My code is as follows;
Dim da As MySqlDataAdapter
Dim data As DataTable
Dim conn As New MySqlConnection
conn = GetConnection(ConnectionDetails)
da = New MySqlDataAdapter("Select * from submissions", conn)
Dim cb As MySqlCommandBuilder = New MySqlCommandBuilder(da)
data = New DataTable
da.Fill(data)
data.Rows(0).Item("Title") = "Testing update"
data.AcceptChanges()
da.Update(data)
conn.Dispose()
Subject
Written By
Posted
update / add row in datatable
May 21, 2007 06:22AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.