[b][red]This message was edited by James98765 at 2007-3-18 7:19:2[/red][/b][hr]
[b][red]This message was edited by James98765 at 2007-3-18 7:16:44[/red][/b][hr]
[b][red]This message was edited by James98765 at 2007-3-18 7:12:37[/red][/b][hr]
[b][red]This message was edited by James98765 at 2007-3-18 5:44:50[/red][/b][hr]
I am trying to make a program where I have four textboxes that will display text from 4 fields in a Microsoft Access Database. This works so far. I also want to be able to change the text in the text boxes and then click on a save button and have them update the text in the database. This is where I have a problem. Something is wrong with my code but I am not sure what. I am using this code for the update in the click event of the button.
Private m_dtGear As New DataTable
Private m_daDataAdapter As New OleDb.OleDbDataAdapter
m_dtGear.Rows(m_rowPosition)("Field1") = txtFP.Text
m_dtGear.Rows(m_rowPosition)("Field2") = txtRPM.Text
m_dtGear.Rows(m_rowPosition)("Field3") = txtGR.Text
m_dtGear.Rows(m_rowPosition)("Field4") = txtFD.Text
m_daDataAdapter = New OleDb.OleDbDataAdapter("Select * FROM Gear", m_cnADONetConnection)
I get this error message during debug mode. When I click the button
An unhandled exception of type 'System.InvalidOperationException'
occurred in system.data.dll
Additional information: Update requires a valid UpdateCommand when passed DataRow collection with modified rows.
Any help would be great because this has been very frustrating to try and figure out. I am kind of new to this so simpler would be better.
Oh yeah. I am using OLEDB