private void button6_Click(object sender, EventArgs e) { if (textBox5.Text == "") { OpenFileDialog openFileDialog3 = new OpenFileDialog(); openFileDialog3.InitialDirectory = "c:\\"; openFileDialog3.Filter = "db files (*.db)|*.db|All files (*.*)|*.*"; openFileDialog3.FilterIndex = 2; openFileDialog3.RestoreDirectory = true; if (openFileDialog3.ShowDialog() == DialogResult.OK) { connect_To_SqlMeta(openFileDialog3.FileName); MessageBox.Show("Connection succeeded"); MetaDbFiller.CreateMetaTables(); MetaDbFiller.FillMetaDb(); MessageBox.Show("MetaDB filling Process succeeded"); } } else if (File.Exists(textBox5.Text)) { connect_To_SqlMeta(textBox5.Text); MessageBox.Show("Connection succeeded"); MetaDbFiller.LoadMetaDB(); MessageBox.Show("MetaDB filling Process succeeded"); } else { MetaDbFiller.dbConnection = DatabaseConnection.CreateEmptyDb(textBox5.Text); MessageBox.Show("New metaDB file made"); MetaDbFiller.CreateMetaTables(); MetaDbFiller.FillMetaDb(); MessageBox.Show("MetaDB filling Process succeeded"); } }
private void button2_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog3 = new OpenFileDialog(); openFileDialog3.InitialDirectory = "c:\\"; openFileDialog3.Filter = "db files (*.db)|*.db|All files (*.*)|*.*"; openFileDialog3.FilterIndex = 2; openFileDialog3.RestoreDirectory = true; if (openFileDialog3.ShowDialog() == DialogResult.OK) { connect_To_SqlMeta(openFileDialog3.FileName); MessageBox.Show("Connection succeeded"); MetaDbFiller.LoadMetaDB(); } }