Beispiel #1
0
 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!!!");
         }
     }
 }
Beispiel #2
0
 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!!!");
         }
     }
 }
 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!!!");
         }
     }
 }
 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!!!");
         }
     }
 }