Пример #1
0
    private void btnCreateDB_Click(object sender, EventArgs e)
    {
        int flag;

        if (txtDBName.Text.Length == 0)
        {
            MessageBox.Show("You must enter a database name.", "Input Error");
            txtDBName.Focus();
            return;
        }

        clsDB myDB = new clsDB(txtDBName.Text); // Pass in new name

        flag = myDB.CreateNewDB(txtDBName.Text);
        if (flag == 1)
        {
            MessageBox.Show("New database created successfully.");
        }
        else
        {
            MessageBox.Show("Could not create new database.");
        }
        dbName = txtDBName.Text;
    }