The source code for the OutlookSyncSQL Iteration 2 sample is at http://msftdbprodsamples.codeplex.com/releases/view/87615.

First, I want to mention that sample iterations will have functional code; however, the sample will not be fully baked until the final release. Therefore, the expectation is that iterations might not contain the same fit and finish as a final release.

As a continuation from the previous blog post, I have created an Outlook Contact Data Sync Iteration 2 document on our SQL Server Samples CodePlex site. This document goes into more details about the OutlookSyncSQL  sample code.

Outlook Contact Data Sync Iteration 2 Contents

The SimpleSync class contains methods to perform SQL Server CRUD operations for Outlook contact items.

The CodePlex source includes

  • InsertContact(Outlook.ContactItem contactItem) - Inserts an Outlook Contact into the AdventureWorksLT2012 customer table, and saves the CustomerID back into a ContactItem. Uses the SalesLT.usp_InsertContact stored procedure that inserts a contact item into the AdventureWorksLT2012 customer and address table as a transaction.
  • InsertContact(DataRow row) - Inserts an Outlook contact from an AdventureWorksLT2012 customer DataRow.
  • UpdateContact(Outlook.ContactItem contactItem) - Updates an AdventureWorksLT2012 customer from an Outlook contact item. Calls the SalesLT.usp_UpdateContact stored procedure that updates a customer from an email address.
  • Outlook.ContactItem UpdateContact(Outlook.ContactItem contactItem, DataRow row) - Updates an Outlook contact item based on an AdventureWorksLT2012 customer DataRow.
  • ReadContacts() - Reads contacts from the AdventureWorksLT2012 customer table performing a simple contact item to SQL Server table sync.
  • Outlook.ContactItem FindContact(string name, string value) – Given an Outlook Contact Item name and value, return the ContactItem.
  • DeleteContact(Outlook.ContactItem contactItem) – Deletes an AdventureWorksLT2012 customer and address as a cascade delete on the SQL Server instance.

We value your feedback on the process of creating SQL Server samples that reflect your needs.

Please post a comment on this page or contact us directly:

Derrick VanArnam (derrickv@microsoft.com)

Susan Joly (susanjo@microsoft.com)