private void butNewdbFromsql_Click(object sender, EventArgs e) { var frm = new FrmNewDbFromSql(); if (DialogResult.OK != frm.ShowDialog()) { return; } if (FileSearch(DatabaseManager.GetDatabaseDefaultPath(), frm.Result + ".mdf").Count > 0 || FileSearch(DatabaseManager.GetDatabaseDefaultPath(), frm.Result + "_log.ldf").Count > 0) { labelResult.Text = "Please check database files"; } else { groupBoxDatabaseManagement.Enabled = false; labelResult.ForeColor = Color.Black; labelResult.Text = "Database creation in progress..."; string[] userInput = { frm.Result, frm.FilePath }; bWDatabaseFromSql.RunWorkerAsync(userInput); } }
private void butNewdbFromsql_Click(object sender, EventArgs e) { var frm = new FrmNewDbFromSql(); if (DialogResult.OK != frm.ShowDialog()) return; if (FileSearch(DatabaseManager.GetDatabaseDefaultPath(), frm.Result + ".mdf").Count > 0 || FileSearch(DatabaseManager.GetDatabaseDefaultPath(), frm.Result + "_log.ldf").Count > 0) { labelResult.Text = "Please check database files"; } else { groupBoxDatabaseManagement.Enabled = false; labelResult.ForeColor = Color.Black; labelResult.Text = "Database creation in progress..."; string[] userInput = {frm.Result, frm.FilePath}; bWDatabaseFromSql.RunWorkerAsync(userInput); } }