At the beginning of the day, they’ll need to sync up with the main database to have the latest information available.
During the day, they’ll make modifications to existing customer data, add new customers, and input new orders.
This is okay because they have a given region or customer base where other people won’t be changing the same records.
It is the Sql Data Adapter that manages connections with the data source and gives us disconnected behavior.
The Sql Data Adapter opens a connection only when required and closes it as soon as it has performed its task.
For example, the Sql Data Adapter performs the following tasks when filling a Data Set with data: In between the Fill and Update operations, data source connections are closed and you are free to read and write data with the Data Set as you need.
These are the mechanics of working with disconnected data.
Because the applications holds on to connections only when necessary, the application becomes more scalable.
A couple scenarios illustrate why you would want to work with disconnected data: people working without network connectivity and making Web sites more scalable.
Consider sales people who need customer data as they travel.
In Lesson 3, we discussed a fully connected mode of operation for interacting with a data source by using the Sql Command object.
In Lesson 4, we learned about how to read data quickly an let go of the connection with the Sql Data Reader.