private void button5_Click(object sender, RoutedEventArgs e) { //delete database using (EmployeeDataContext Empdb = new EmployeeDataContext(strConnectionString)) { if (Empdb.DatabaseExists()) { Empdb.DeleteDatabase(); MessageBox.Show("Employee Database Deleted Successfully!!!"); } } }
private void button1_Click(object sender, RoutedEventArgs e) { //create database using (EmployeeDataContext Empdb = new EmployeeDataContext(strConnectionString)) { if (Empdb.DatabaseExists() == false) { Empdb.CreateDatabase(); MessageBox.Show("Employee Database Created Successfully!!!"); } else { MessageBox.Show("Employee Database already exists!!!"); } } }