Skip to content

SetDataProvider Method

See also

Description

Sets the Data Provider for the Calendar Control.

Syntax

Public Sub SetDataProvider(ByVal ConnectionString As String)

Parameters

  • ConnectionString — String containing the name and type of the data provider. This value will be stored in the ConnectionString property.

Remarks

The data provider can save event information as an XML file, binary file, Microsoft Database (mdb) file, MAPI (Outlook 2003 format), memory, SQL Server, MySQL, and "custom". The type of file/data created depends on the type specified when the SetDataProvider method is called.

The built-in data providers are the Memory provider, MS Access database provider, and the MAPI Outlook data provider. The calendar handles all data functionality internally with the built-in data providers. The "DoXXXX" (for example, DoCreateEvent) events are not fired when using a built-in data provider.

The "Custom" data providers include SQL Server, MySQL, and Custom provider types. Custom data providers operate in an "unbound" mode. All data must be provided to and retrieved from the calendar by the developer. All of the "DoXXXX" (for example, DoCreateEvent) events will be fired when using a custom data provider; the developer must implement their own functionality for each event. For example, when an event is created using the CreateEvent method, the DoCreateEvent is fired. The developer can then add code in the DoCreateEvent handler to add the event to a database or some other custom data source. For all custom data providers, the ConnectionString must contain "Provider=custom".

See the ConnectionString Sample to learn how to format the connection strings.

The currently used connection string is stored in the ConnectionString property.

See the SetDataProvider Sample for examples of how to create each type of data provider.

See also

Example


Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.