RAD Studio for Microsoft .NET
ContentsIndex
PreviousUpNext
Creating a Briefcase Application with DB Web Controls

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

  1. Create a BDP.NET application.
  2. Add a DBWebDataSource control and link to the BDP DataSet.
  3. Configure the DBWebDataSource control to generate XML and XSD files.
  4. Configure the AutoUpdateCache and UseUniqueFileName properties.
  5. Configure an OnApplyChangesRequest to call the BdpDataAdapterAutoUpdate method.
  6. Run the application.

To configure the AutoUpdateCache and UseUniqueFileName properties

  1. Build a standard ASP.NET database application using the BDP.NET components and the DBWebDataSource component.
  2. 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.
  3. Set AutoUpdateCache to True.
  4. Set UseUniqueFileName to True.
  5. Select the Events tab for the DBWebDataSource component.
  6. Double-click the OnApplyChangesRequest field to display the event handler in the Code Editor.
  7. Add the following code:

BdpDataAdapter1.AutoUpdate;

  1. 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.

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!