Acme.PROJECTNAME.Install.IdentifyDatabaseForm.CreateDatabase C# (CSharp) Method

CreateDatabase() private method

private CreateDatabase ( ) : bool
return bool
		private bool CreateDatabase()
		{
			bool error = false;
			string connectString = SqlServers.BuildConnectionString(radioButtonCreationIntegratedSecurity.Checked, string.Empty, comboBoxCreationServerName.Text, textBoxCreationUserName.Text, textBoxCreationPassword.Text);
			if (SqlServers.TestConnectionString(connectString) && SqlServers.HasCreatePermissions(connectString))
			{
				try
				{
					SqlServers.CreateDatabase(connectString, textBoxCreationDatabaseName.Text);
				}
				catch (Exception ex)
				{
					error = true;
					System.Diagnostics.Debug.WriteLine(ex.ToString());
					MessageBox.Show("Could not create database." + Environment.NewLine + ex.Message);
				}
			}
			else
			{
				error = true;
				MessageBox.Show("The account does not have permissions to create a database on this server.");
			}
			return error;
		}