Exemple #1
0
 public bool TestConnection()
 {
     using (var db = new DATAContext())
     {
         DbConnection conn = db.Database.Connection;
         try
         {
             conn.Open();                       // check the database connection
             return(true);
         }
         catch
         {
             return(false);
         }
     }
 }