Kentico CMS 6.0 Developer's Guide

Custom Data Provider

Custom Data Provider

Previous topic Next topic Mail us feedback on this topic!  

Custom Data Provider

Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic!  

The Custom Data Provider can be used to implement your own database connector. Customizations for this provider cannot be done in the App_Code folder. They must be added through a new assembly and registered via a specific web.config key as described below.

 

Please note: The Custom Data Provider is NOT intended for accessing non-Microsoft SQL Server database engines. It is only intended for minor modifications of the way the queries are executed against the Microsoft SQL Server.

 

1. Open the web project in Visual Studio.

 

2. Copy the CustomDataProvider project from <installation directory>/CodeSamples to your Solution directory.

 

3. Add the project CustomDataProvider to the solution.

 

4. Add a reference to the new project to your website project.

 

5. Add references to the IDataConnectionLibrary, SettingsProvider, DirectoryUtilities a GlobalHelper libraries located in the website project to the CustomDataProvider project.

 

6. Build the solution.

 

7. Add the following key to the AppSettings section of your web.config file:

 

<add key="CMSDataProviderAssembly" value="CMS.CustomDataProvider"/>

 

8. Run the website, it should now use the CustomDataProvider library.

 

9. If everything works correctly, you can modify the code of the Custom Data Provider as needed.