public void CheckConnection() { try { using (var ctx = new SystemCompanyEntities()) { ctx.Connection.Open(); int resultNum = ctx.ExecuteStoreCommand("BACKUP DATABASE SystemCompany TO DISK = '//SystemCompany.bak' WITH FORMAT"); } } catch (Exception ex) { throw new Exception(ex.Message); } }