Data tables therefore provide special methods for deleting records so this information can be retained.

updating database in vb net-16

I think you need something close to this, and substitute whatever is appropriate for my myqry = "UPDATE Accounts SET Stud No=?

You need to add the third parameter value, but I don't know where that comes from.

Hide() End Sub includes 3 parameters but your code supplies values for only 2 of them.

Since each record in a dataset is represented by a Data Row object, changes to a dataset are accomplished by updating and deleting individual rows.

Additionally, new records can be inserted into the dataset by adding new Data Row objects to the Data Table objects' Rows collection.

You can manipulate the collection directly to delete records.

However, if you want to send changes to the database or to another process, the dataset has to maintain change information for deleted rows.

Execute Non Query() public sub Update Accounts() Connect() 'connect to the database method cmd = new Ole Db Command("Update Accounts set Stud No = '" + my ID.

And your answer (compared to OP's code) is wide open for SQL injection!