The WebScheduleGenericDataProvider™ component allows you to bind the WebSchedule™ controls to any supported data sources. This addition of the WebScheduleGenericDataProvider component gives you more flexibility in choosing WebSchedule data sources; you no longer need to rely on just the SqlDataProvider or the OleDbDataProvider for data binding.
Your scheduling data can be in any schema you choose. The WebScheduleGenericDataProvider component allows you to specify the data source you are binding to by providing the following properties: ActivityDataSource/ ActivityDataSourceID, ResourceDataSource/ ResourceDataSourceID, and VarianceDataSource/ VarianceDataSourceID.
You can retrieve as many fields as you like from your data entities; you can then access these fields via the Activity and Resource object’s DataRow property. You can also specify the specific fields you want to bind to by setting the corresponding properties in the AppointmentBinding, ResourceBinding, and VarianceBinding objects. Set a specific binding if your data model does not match WebSchedule’s data model bindings (i.e. if the fields' names in your data source differ from the default ones in the AppointmentBinding, VarianceBinding, and ResourceBinding classes). To examine the default data schema, see Data Model for WebSchedule Generic Data Provider.
The data model for WebSchedule has changed since the addition of WebScheduleGenericDataProvider. First thing you will notice is that the Recurrence table is removed and additional fields are added to the Activity and Resource table. The following table lists the required fields for the different types of data to function correctly in WebSchedule.
The following is a list of WebScheduleGenericDataProvider’s supported data sources.
DataSet and DataTable
IListSource
IDataSource
IEnumerable (read-only, updates must be IList or ICollection)
When binding to data source controls such as SqlDataSource or AccessDataSource, configure the Select, Update, Insert, and Delete statements to correspond to your Activity, Resource, and/or Variance data. This means you need separate data source controls for each type of data, but not necessarily separate data sources. It is not mandatory to have an additional data source control defined for variance data if it is intended for display only (no CRUD statements); you can retrieve variance data from the same data source as appointments if OriginalStartDateTimeUtc is defined as a field in the data source. For an example of how to correctly configure the CRUD statements for data source controls, see Binding to Access Data Source Control Using WebScheduleGenericDataSource.
Instead of CRUD statements, WebScheduleGenericDataProvider automatically updates and deletes data when binding to data source objects. When adding new data, you need to set the DataKey of the object you are adding. For example, if you are adding an Activity object, handle the ActivityAdding event and set the Activity object’s DataKey property. You can use the DataKey property to locate and update the data in your data base. For more information on binding to data source objects, see WebSchedule Binding to a Data Set with WebScheduleGenericDataProvider.
You can enable concurrency checks in data source controls by setting WebScheduleGenericDataProvider’s EnableConcurrencyChecks property to True. Your Update statement must contain the following Where clause:
… WHERE [ID] = @ID AND [Timestamp] = @Timestamp"
TimeStamp is a field in your data source that represents the timestamp of each record. If there are concurrency conflicts in data updates, the DataProviderError event is raised.