You can use DB Web Controls, XML caching, and the BDP.NET data adapters to create server-side briefcase applications. You can only create this type of application when using user authentication, to guarantee that each user has a unique copy of the XML file.
Note: DB Web Controls (Borland.Data.Web namespace) are being deprecated in 2007. You should use standard Web controls instead.
To create a briefcase application
- Create a BDP.NET application.
- Add a DBWebDataSource control and link to the BDP DataSet.
- Configure the DBWebDataSource control to generate XML and XSD files.
- Configure the AutoUpdateCache and UseUniqueFileName properties.
- Configure an OnApplyChangesRequest to call the BdpDataAdapterAutoUpdate method.
- Run the application.
To configure the AutoUpdateCache and UseUniqueFileName properties
- Build a standard ASP.NET database application using the BDP.NET components and the DBWebDataSource component.
- Specify XML and XSD filenames for non-existent files in the DBWebDataSource component.
Note: It is best to create these files in the project directory or in a subdirectory of the project directory, typically on your web server.
- Set AutoUpdateCache to True.
- Set UseUniqueFileName to True.
- Select the Events tab for the DBWebDataSource component.
- Double-click the OnApplyChangesRequest field to display the event handler in the Code Editor.
- Add the following code:
BdpDataAdapter1.AutoUpdate;
- Choose RunRun. The first time the application runs, it creates the XSD file using the server metadata.
The first time a user runs the application, the application retrieves data from the server. When the user changes data, thereafter, the application saves those changes to the server in a unique filename based on the username. If the user shuts down the application and runs it again at a later time, the application restores the user's specific data. At this point, the user can undo or modify the data. Anytime the OnApplyChangesRequest is called successfully, the application deletes the unique user files and creates new ones.
Warning: If the tables or columns accessed by the application are altered after the application has run, you must delete the XSD file to avoid a mismatch between the XSD file and the server metadata. Otherwise, you can experience runtime errors and unpredictable behavior.