public static void dept() { DepartmentDao dao = new DepartmentDao(); Department bean = dao.loadByName("人事部"); }
// you should delete the info in Manager.Department // you need finish it // delete the Access db public static bool DeleteAccessDb(string dbName) { // delete from the info in department DepartmentDao dao = new DepartmentDao(); Department bean = dao.loadByName(dbName); dao.delete(bean.Id); // delete the access file string url_path = ConfigurationManager.AppSettings["path"].ToString(); string path = url_path + "" + dbName + ".accdb"; // if the file is exist,then,delete it if (File.Exists(path)) { File.Delete(path); } return true; }