using System.Data; using RS.DBUtility; namespace RS.SQLServerDAL { public class SDataBaseManage { /// /// 数据库是否连接 /// /// public bool DBIsConnected() { bool isConnected = false; try { MySqlHelper sqlHelper = new MySqlHelper(); sqlHelper.DBConnection(); //确认是否已打开连接,为打开则打开连接 if (sqlHelper.SqlConn.State == ConnectionState.Open) { isConnected = true; } return isConnected; } catch { return isConnected; } } } }