private bool SaveProfile()
        {
            bool result = true;
            //Check that all fields are provided
            if (string.IsNullOrEmpty(textBoxProfileName.Text))
            {
                MessageBox.Show("Profile Name is mandatory!");
                return false;
            }

            if (comboBoxOperation.SelectedItem == null)
            {
                MessageBox.Show("The Operation is Mandatory!");
                return false;
            }

            //Check that the name of the connection is valid
            if (textBoxProfileName.Text.Contains(" ") ||
                    textBoxProfileName.Text.Contains("\\") ||
                    textBoxProfileName.Text.Contains("/") ||
                    textBoxProfileName.Text.Contains(">") ||
                    textBoxProfileName.Text.Contains("<") ||
                    textBoxProfileName.Text.Contains("?") ||
                    textBoxProfileName.Text.Contains("*") ||
                    textBoxProfileName.Text.Contains(":") ||
                    textBoxProfileName.Text.Contains("|") ||
                    textBoxProfileName.Text.Contains("\"") ||
                    textBoxProfileName.Text.Contains("'")
                    )
            {
                MessageBox.Show("You shouldn't use spaces nor the following characters (\\/<>?*:|\"') in the Profile Name as it will be used to create folders and files.");
                return false;
            }

            if (comboBoxConnectionSource.SelectedItem == null)
            {
                MessageBox.Show("You must select a Source for the Profile");
                return false;
            }

            if (this.textBoxSelectedFolder.Text == "")
            {
                MessageBox.Show("You must select an Export Folder for the Profile");
                return false;
            }

            if (comboBoxOperation.SelectedItem.ToString() != "Export Solutions")
            {
                if (comboBoxConnectionTarget.SelectedItem == null)
                {
                    MessageBox.Show("The Target Connection is Mandatory!");
                    return false;
                }
                if (comboBoxSolutionsToImport.SelectedItem == null)
                {
                    MessageBox.Show("The Solutions to Import are Mandatory!");
                    return false;
                }
            }

            dataGridView1.EndEdit();

            MSCRMSolutionsTransportProfile tempProfile = new MSCRMSolutionsTransportProfile();
            tempProfile.ProfileName = textBoxProfileName.Text;
            tempProfile.SourceConnectionName = comboBoxConnectionSource.SelectedItem.ToString();

            tempProfile.SelectedSolutionsNames = new List<string>();
            foreach (DataGridViewRow row in dataGridView1.Rows)
            {
                DataGridViewCell cbc = row.Cells[0];

                if ((bool)cbc.Value)
                {
                    MSCRMSolution ms = (MSCRMSolution)row.DataBoundItem;
                    tempProfile.SelectedSolutionsNames.Add(ms.UniqueName);
                }
            }
            if (tempProfile.SelectedSolutionsNames.Count == 0)
            {
                MessageBox.Show("You must select at least 1 Solution for the Profile");
                return false;
            }

            tempProfile.SolutionExportFolder = textBoxSelectedFolder.Text;
            tempProfile.ExportAsManaged = checkBoxExportAsManaged.Checked;
            tempProfile.Operation = comboBoxOperation.SelectedIndex;
            tempProfile.ExportAutoNumberingSettings = checkedListBoxSettings.GetItemChecked(0);
            tempProfile.ExportCalendarSettings = checkedListBoxSettings.GetItemChecked(1);
            tempProfile.ExportCustomizationSettings = checkedListBoxSettings.GetItemChecked(2);
            tempProfile.ExportEmailTrackingSettings = checkedListBoxSettings.GetItemChecked(3);
            tempProfile.ExportGeneralSettings = checkedListBoxSettings.GetItemChecked(4);
            tempProfile.ExportMarketingSettings = checkedListBoxSettings.GetItemChecked(5);
            tempProfile.ExportOutlookSynchronizationSettings = checkedListBoxSettings.GetItemChecked(6);
            tempProfile.ExportRelationshipRoles = checkedListBoxSettings.GetItemChecked(7);
            tempProfile.ExportIsvConfig = checkedListBoxSettings.GetItemChecked(8);
            tempProfile.setSourceConneciton();
            tempProfile.PublishAllCustomizationsSource = checkBoxPublishAllCustomizationsSource.Checked;

            if (comboBoxConnectionTarget.SelectedItem != null)
            {
                tempProfile.TargetConnectionName = comboBoxConnectionTarget.SelectedItem.ToString();
                tempProfile.setTargetConneciton();
            }
            if (comboBoxSolutionsToImport.SelectedItem != null)
                tempProfile.SolutionsToImport = comboBoxSolutionsToImport.SelectedItem.ToString();
            tempProfile.PublishAllCustomizationsTarget = checkBoxPublishAllCustomizationsTarget.Checked;
            tempProfile.PublishWorkflows = checkBoxPublishWorkflows.Checked;
            tempProfile.OverwriteUnmanagedCustomizations = checkBoxOverwriteUnmanagedCustomizations.Checked;

            //Check if this is a creation
            if (currentProfile == null)
            {
                //Check if a Solution Transport Profile having the same name exist already
                MSCRMSolutionsTransportProfile profile = man.Profiles.Find(p => p.ProfileName.ToLower() == textBoxProfileName.Text.ToLower());
                if (profile != null)
                {
                    MessageBox.Show("Profile with the name " + textBoxProfileName.Text + " exist already. Please select another name");
                    return false;
                }

                man.CreateProfile(tempProfile);
                comboBoxProfiles.Items.AddRange(new object[] { tempProfile.ProfileName });
                comboBoxProfiles.SelectedItem = tempProfile.ProfileName;
                currentProfile = tempProfile;
            }
            else
            {
                currentProfile = tempProfile;
                man.UpdateProfile(currentProfile);
            }

            runProfileToolStripMenuItem.Enabled = true;
            toolStripStatusLabel1.Text = "Profile " + currentProfile.ProfileName + " saved.";
            return result;
        }