I am quite new to VB.net and I am struggling with the datagrid. I want to
let the user modify data in the grid and then click the save button and this
will update the database. I guess I am having trouble understanding the
update command and the parameters. The data is coming from an SQL query on
2 tables, but I will only need to update one of them. I got the grid to
show the data but I can't get it to update. This is my SQL statement
Private Const SELECT_STRING = "SELECT equipment.eqp_description, as
Equipment,io_master.io_number, io_master.io_panel_id,equipment.eqp_id,
io_master.equipment_io_function FROM io_master Left outer join equipment on
io_master.eqp_id = equipment.eqp_id order by io_master.io_number"
My update needs to be this:
UPDATE io_master SET equipment_io_function = ? WHERE io_panel_id = ?
I'm guessing that this is right:
Dim cupdate As OdbcCommand = New OdbcCommand("UPDATE io_master SET
equipment_io_function = ? WHERE io_panel_id = ?", OdbcConnection)
and then I set the odbcAdapter.updatecommand = cUpdate
My problem is I don't quite understand the cUpdate.Parameters.add
Can someone help me with what I should put in there?