Welcome to the SQL Server and SQL Azure samples blog. I’m a Technical Writer on the SQL Server Customer Experience team. Recently, I accepted the position at Microsoft because one of my passion is connecting with the customer. Hopefully, this blog will help you apply SQL Server and SQL Azure samples to achieve results in your business endeavors.

Recently, our team started investigating how to apply agile development principles and practices to deliver customer samples. We want to get your feedback while we develop a sample. The idea is to break down a sample into user stories and short iterations. Then, our team will publish iterations with the goal of acquiring frequent customer feedback about the sample. Frequent customer feedback allows us to focus our sample’s development efforts on your needs.

As an early pilot for the idea, I recently created user stories and a first iteration for an Outlook Data Sync sample. This idea came from a customer request on MSDN samples (Outlook Contact custom sync provider). The sample request has 42 votes. Thank you to those who voted. The ultimate goal of this sample is to address how to synchronize Outlook contacts with SQL Express and SQL Server (or SQL Azure).

User Stories

My first step was to define the sample user stories.

  1. As an Outlook user, I want to synchronize contact fields to a SQL database.
  2. As an Outlook user, I am occasionally disconnected from the network / Internet. Therefore, I need my contacts available while offline.
  3. As a user, I want to manual synchronize my Outlook contacts with a contact table.
  4. As a user, I want my contacts automatically synchronized with a SQL Server or SQL Azure contact table.
  5. As a user, I want to be able to easily configure the sample application.
  6. As an administrator, I need to allow a list of specific users to read/write to a specific SQL table during a synchronization session.
  7. As a user, I want to easily install, and cleanly un-install the Contact Sync Add-in
  8. As an Outlook user, I want to see the progress of an Outlook / contacts table synchronization.
  9. As an Outlook user, I want to view a history of synchronization values.
  10. As a user, all of my existing contacts must be preserved while and after running the sample.

Iteration 1

Then, I decided that wiring up the Outlook add-in to perform CRUD operations against a local SQL Server Express database would be the first iteration to address user stories 1, 2, 3, and 10. As far as user story number 10, the sample will use the AdventureWorksLT2012 sample database.

Iteration 1 Unit Tests

Test-first development is an efficient means to write specific methods that use the Visual Studio .NET 2010 Unit Testing Framework. One of the advantages of creating discrete unit test methods is that you focus on verifying that specific functionality works and does what it should do. For example, a unit test can test inserting an Outlook Contact item:

Visual Studio 2010 Test Results


Outlook Add-in and SQL Server

This post will not go into details about how to CRUD SQL Server operations from an Outlook add-in. However, you might be interested that the sample handles SQL Server contact inserts, reads, updates and deletes automatically while using Outlook:

Insert

      void _contactFolderItems_ItemAdd(object Item)

      {

        ContactItem item = Item as ContactItem;

        simpleSync.InsertContact(item);

      }

Reads

      void m_Explorer_FolderSwitch()

      {

        if (this.Application.ActiveExplorer().CurrentFolder.Name == "Contacts")

        {

          simpleSync.ReadContacts();

        }

      }

Updates

      void contactItem_Write(ref bool Cancel)

      {

        simpleSync.UpdateContact(contactItem);

      }

Deletes

      void contactItem_BeforeDelete(object Item, ref bool Cancel)

      {

        simpleSync.DeleteContact(Item as ContactItem);

      }

An upcoming blog post will show more unit tests, and discuss how to perform CRUD SQL Server operations from an Outlook add-in.

You can read MSF for Agile Software Development v5.0 to learn more about agile principles. I want this blog to be a journey for everyone as we learn more about agile principles and using SQL Server and Azure to deliver business results.

We value your feedback. In fact, our team’s charter is to engage with the customer to deliver value-added content and samples. Please provide feedback or questions directly on this blog.

Or contact us directly:  Derrick VanArnam (derrickv@microsoft.com) or Susan Joly (susanjo@microsoft.com)