The CData Data Providers make it easy to build applications that need to move data from one source to another. The simple, uniform SQL syntax makes it easy to retrieve and update data in Google and SharePoint.
This article shows how to use the demo Windows application to sync Google and SharePoint calendars.
Connect to Google and SharePoint
To connect to Google, specify the User and Password connection properties. Alternatively, you can use OAuth.
To connect to SharePoint On-Premise, specify the User and Password properties and set the AuthScheme to NTLM. To connect to SharePoint Online, set AuthScheme to NONE and set the User and Password connection string properties. For more details on connecting to SharePoint Online, see Integration With SharePoint Online.
See the "Getting Started" chapter in the help documentation for a guide to connecting with the providers.
Retrieve the Events
Follow the steps below to use simple SQL queries to retrieve calendar events from Google and SharePoint.
- Google accounts can have several calendars. Obtain a list of a user's Google Calendars by issuing a query to the Calendars table. For example: SELECT * FROM Calendars.
- In order to get a list of the events from a given Google Calendar, issue a query to the CalendarEvents table that specifies the CalendarId in the WHERE clause. The resulting events can be further filtered by using the StartDateTime or EndDateTime columns. For example:
- The SharePoint data provider models each SharePoint list as a table. Get the events in a particular calendar by querying the table with the same name as the list. The events may be filtered further by specifying the EventDate or EndDate columns. For example:
Synchronize the Events
Synchronizing the events is a simple process. Once the events from Google and SharePoint are available they can be compared and synchronized based on user preference. The sample application does this based on user input, but it is easy to create one that does the synchronization automatically. The standard SQL syntax of the CData data providers makes it easy to create, update, or delete events as needed.
Pre-Built Demo Application
You can run the demo application by downloading the executable for the demo application.
You can download the full source of the demo application; you will also need the Google ADO.NET Data Provider and theSharePoint ADO.NET Data Provider.