private void tsbttnCreateNewBankCollectionFile_Click(object sender, EventArgs e) { frmInputText inpBox = new frmInputText("Create spectrum bank collection file"); if (inpBox.ShowDialog() == DialogResult.OK) { FolderBrowserDialog fb = new FolderBrowserDialog(); if (fb.ShowDialog() == DialogResult.OK) { spectrumBankName = fb.SelectedPath + "\\" + inpBox.tbNewBankName.Text + ".s3db"; createNewSpectrumBankCollectionFile(spectrumBankName); } } }
private void tsbttnCreateNewBank_Click(object sender, EventArgs e) { frmInputText inputBankName = new frmInputText("Create new bank"); if (inputBankName.ShowDialog() == DialogResult.OK) { using (SQLiteConnection cnn = new SQLiteConnection(cnsb.ConnectionString)) { cnn.Open(); using (SQLiteCommand cmd = new SQLiteCommand()) { cmd.Connection = cnn; cmd.CommandText = "INSERT INTO banks (name) VALUES('" + inputBankName.tbNewBankName.Text + "')"; cmd.ExecuteNonQuery(); currentBank = inputBankName.tbNewBankName.Text; this.Text = "Bank name: " + inputBankName.tbNewBankName.Text; } } LoadAvailableBankNames(); } }