Hi all,
I couldn't able to update the record to database (MS ACCESS). Below is the code. What might be wrong in the code.
Thanks, Your help will be greatly appreciated.
I couldn't able to update the record to database (MS ACCESS). Below is the code. What might be wrong in the code.
HTML:
Try
con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=DataBase.mdb;Persist Security Info=False")
con.Open()
Sql = "SELECT * FROM tblContacts"
da = New OleDb.OleDbDataAdapter(Sql, con)
da.Fill(ds, "datatable")
dsNewRow = ds.Tables("datatable").NewRow()
dsNewRow("Speed") = "078.8"
dsNewRow("Displacement") = "099.5"
dsNewRow("AxialForce") = "099.5"
dsNewRow("FrictionalForce") = "099.5"
ds.Tables("datatable").Rows.Add(dsNewRow)
da.Update(ds, "datatable")
con.Close()
MsgBox("Updated Successfully")
Catch ex As Exception
MsgBox("Unable Update the Data")
End Try