Hi,
i am trying to parameterize my query, but for some reason it seems things go smoothly at runtime (i get no exceptions), but then there is no update in my Access database. i must be missing something - any ideas?
Here is my code:
i am trying to parameterize my query, but for some reason it seems things go smoothly at runtime (i get no exceptions), but then there is no update in my Access database. i must be missing something - any ideas?
Here is my code:
Code:
Me.OleDbDataAdapter2 = New OleDb.OleDbDataAdapter("select * from Nuclear_Extension", Me.OleDbConnection1)
updateCommand2 = New OleDb.OleDbCommand("INSERT INTO Nuclear_Extension (SS_Event_Nuclear_ID, NYHA, MDReferring) VALUES (?, ?, ?)", Me.OleDbConnection1)
add parameters
updateCommand2.Parameters.Add(New OleDb.OleDbParameter("SS_Event_Nuclear_ID", OleDb.OleDbType.Integer))
updateCommand2.Parameters.Add(New OleDb.OleDbParameter("NYHA", OleDb.OleDbType.Integer))
updateCommand2.Parameters.Add(New OleDb.OleDbParameter("MDReferring", OleDb.OleDbType.VarChar, 30))
updateCommand2.Prepare()
Me.OleDbDataAdapter2.InsertCommand = updateCommand2
Me.OleDbDataAdapter2.MissingSchemaAction = MissingSchemaAction.AddWithKey
Me.OleDbDataAdapter2.Fill(Me.DataSet1, Me.NuclExtension)
updateCommand2.Parameters.Item("NYHA").Value() = Integer.Parse(Me.NYHA.Text)
updateCommand2.Parameters.Item("MDReferring").Value() = Me.RefMD.Text
updateCommand2.Parameters.Item("SS_Event_Nuclear_ID").Value() = Me.EventNuclID
update the database
Me.OleDbDataAdapter2.Update(Me.DataSet1, Me.NuclExtension)