コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
            }
        }