Updating dataadapter access
To change an existing row's data, you can directly assign a row's value.
To save data to the data source, you need to call the Data Adapter's Update method.
These are the mechanics of working with disconnected data.
Because the applications holds on to connections only when necessary, the application becomes more scalable.
This Lesson shows how to accomplish something in-between Sql Connection and Sql Data Reader interaction by using the Data Set and Sql Data Adapter objects.
A Data Set is an in-memory data store that can hold numerous tables.
Another scenario is making a Web site more scalable.
Listing 5-46 Creates a new Data Row, sets the data of Data Row members, and adds rows to the table using the Add method of Data Table. I'll display the result of the Customers table in a Data Grid after adding, updating, and deleting data from the table.
This is okay because they have a given region or customer base where other people won’t be changing the same records.
At the end of the day, the sales person will connect to the network and update changes for overnight processing.
For example, if you call Delete on a row on the Data Set, then when Update is called on the Data Adapter, the Delete Command of the Data Adapter will be called using the particular row in the Data Set.
Note: Keep in mind that this Update is different than a SQL UPDATE statement.