Updating database from datagridview in vb net
After the data in your dataset has been modified and validated, you can send the updated data back to a databaseby calling the method updates a single data table and runs the correct command (INSERT, UPDATE, or DELETE) based on the Row State of each data row in the table.When a dataset has related tables, Visual Studio generates a Table Adapter Manager class that you use to do the updates.When a database receives a SQL statement, it determines if the statement has already been executed and stored in memory.If the statement does exist in memory, Oracle Database can reuse it and skip the task of parsing and optimizing the statement.
I have faced a very common problem of cross thread exception.
When you start reading the code from the beginning, there is an when making calls to the SQL server list, databases, and tables.
This is done because only one call back method handles all call backs from async calls.
Simply use Execute Scalar (see an example in the link above) And the darareader is obly close when counter is 1.
By concatenating the SQL string, your code is vulnarable to SQL injections. NET-with-MS-Access Also, to get one value of one record in a select statement, it is an overkill to use a datareader.