How to Generate and Work with XSDs
(This page is considered "good" on a technical level, but is pending review for grammar and typos)
Strongly typed datasets are the simpliest way to work with data retrieved from a Data Abstract-based server. Strongly typed datasets provide many benefits, f.e. build-time type checks, IntelliSense (code completion) support etc. Strongly typed dataset defintion used in a Data Abstract client application should match the coresponding Data Abstract server's Server Schema.
The article below describes how to regenerate Strongly typed dataset defintion when a server's Schema is changed using the strongly typed dataset generator (or DataSet Wizard as it is called in the article below).
Adding new client connectivity
The .XSD Wizard can be invoked from a Data Adapter's context menu:
When invoked the .XSD Wizard will allow to select the possible connection type:
- Proceed with an existing .daSchema, .daRemoteSchema or .relatvityClient file, if one exists in current solution.
- Connect to an existing Relativity Server domain.
- Freshly connect to an existing remote Data Abstract server.
The last two options will ask for the connection parameters for the server to connect to, and then automatically add a new .daRemoteSchema or .relativityClient file to the project, alongside the generated dataset definition file.
Note: The DataSet Wizard doesn't add any references to RemObjects Data Abstract assemblies to the client project while generating the dataset definition. The references to RemObjects assemblies should be added manually, if needed.
This Wizard page is displayed when an existing .daSchema files is selected (either a .daSchema file included into the solution or a local .daSchema file).
This Wizard page allows to specify three things:
- The dataset definition to generate or update. If there’s already one (or more) existing dataset definitions in the current solution, an existing file can be selected (from any of the solution's projects); also a new file to be created can be specified.
- The list of tables to generate dataset tables for.
After the Finish button is pressed the dataset definition file will be created (or updated).
This Wizard page is opened when an existing .daRemoteSchema file is selected or a new custom Data Abstract server connection option is selected:
.daRemoteSchema files store remote server connection settings (however they do not store user passwords or server AES password, if any). The Project Wizard (or the DataSet Wizard) will automatically add these files to the client project as needed.
The DataSet Wizard gathers the location and connection options for the remote server from the .daRemoteSchema file and allows to adjust them if necessary. After the Next button is pressed, the DataSet Wizard fetches the schema from the server (which should be running and accessible), and then continues on to the same page as for the .daSchema file.
Note: The .daRemoteServer file doesn't store any login information and/or server's AES password, so it can be safely added to a version control. Credentials are encrypted and stored in a separate .daRemoteSchema.user file for future reference, so it is not needed to re-enter login data every time the DataSet Wizard is invoked.
.relativityClient files serve the same purpose as the .daRemoteSchema files except they provide reference to a Relativity Server, not a custom Data Abstract-based servers.
Once again, the Project Wizard (or the DataSet Wizard) will automatically add these files to the client project as needed.
This Wizard page is opened when an existing .relativityClient file is selected or a new custom Relativity Server connection option is selected:
This page allows to verify or update the server address (the DataSet Wizard and .relativityClient files also support ZeroConf-discovered servers), and select a Domain and Schema to work with. All these settings will be persisted in the .relativityClient file for future reference. After the Next button is pressed, the DataSet Wizard fetches the schema from the server (which should be running and accessible), and then continues on to the same page as for the .daSchema file.
New Strongly Typed Dataset Wizard streamlines the dataset definition generator interface and allows to store the server connection parameters.