Share via


Data Caching

Because Word and Excel have no built-in concept of programmatic data, you have been limited in your ability to effectively develop solutions around the data stored within the documents. Visual Studio 2005 Tools for Office now allows data to be embedded as XML data islands for server access. This type of data caching makes it possible for the data to be available offline, and it is key in the separation of view and data. Storing the data in a data island provides a mechanism for enabling offline scenarios and N-tier architectures. When a user first opens a document or requests the document from the server, the data island fills with the most recent data. The data island is cached in the document and is then available offline. When the user reconnects, you can propagate the changes to the data back to a server data source. Meanwhile you can access data in the cache from applications outside of Office, for example from a console application, a Windows Forms application, or a Web page.

Caching is not limited to DataSets, and the cached data is not required to be data bound to host controls. To cache a data instance in a document, mark it with the CachedAttribute attribute. Server-side code can manipulate any data instances marked with the CachedAttribute attribute.