private void fromSqlToolStripMenuItem_Click(object sender, EventArgs e)
 {
     TrackingProfileStore profileStore = new TrackingProfileStore();
     string error;
     if (!profileStore.ValidateConnection(out error))
     {
         MessageBox.Show("Error establishing connection to SQL: " + error, "Error connecting to SQL");
         return;
     }
     Type workflowType;
     TrackingProfile profile;
     profileStore.LoadWorkflowAndProfile(out workflowType, out profile);
     if (workflowType != null && profile != null)
     {
         WorkflowType = workflowType;
         profileManager.TrackingProfile = profile;
         InitializeProfileDesigner(workflowType, profile);
     }
 }
 /// <summary>
 /// Saves a tracking profile to the Sql store
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void saveProfileToSql_Click(object sender, EventArgs e)
 {
     TrackingProfileStore profileStore = new TrackingProfileStore();
     try
     {
         if (profileManager == null) throw new ApplicationException("Need to load a profile first");
         profileManager.SerializeProfile();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error serializing profile");
         return;
     }
     string error;
     if (!profileStore.ValidateConnection(out error))
     {
         MessageBox.Show("Error establishing connection to SQL: " + error, "Error connecting to SQL");
         return;
     }
     profileStore.SaveProfile(WorkflowType, profileManager.TrackingProfile);
 }