dating in secret - Updating dataset c

Use disconnected data when your information is primarily read only, but consider other alternatives (such as using Sql Command object for immediate update) when your requirements call for something more dynamic.Also, if the amount of data is so large that holding it in memory is impractical, you will need to use Sql Data Reader for read-only data.

updating dataset c-63updating dataset c-71updating dataset c-73

Updating dataset c

The code showed how to specify the select statment, but didn’t show the insert, update, and delete statements.

These are added to the Sql Data Adapter after it is instantiated.

It is the Sql Data Adapter’s responsibility to open and close the connection during Fill and Update method calls.

As indicated earlier, the Sql Data Adapter contains all of the commands necessary to interact with the data source.

You just create a new instance, just like any other object: The Data Set constructor doesn’t require parameters.

However there is one overload that accepts a string for the name of the Data Set, which is used if you were to serialize the data to XML.

This requires a new connection for each page load, which will hurt scalability as the number of users increase.

One way to relieve this is to use a Data Set that is updated one time and stored in cache.

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.

Tags: , ,