Ejemplo n.º 1
0
        /// <summary>
        /// 得到指定数据库的系统信息
        /// </summary>
        public static DbSysInformation GetDbSysInformation(string dbIP, string user, string pwd, string dbName)
        {
            DbSysInformation[] dbInfos = DBSystemHelper.GetAllDbSysInfos(dbIP, user, pwd);
            for (int i = 0; i < dbInfos.Length; i++)
            {
                if (dbInfos[i].Name == dbName)
                {
                    return(dbInfos[i]);
                }
            }

            return(null);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 判断某个数据库是否存在
        /// </summary>
        public static bool IsDbExist(string dbIP, string user, string pwd, string dbName)
        {
            DbSysInformation[] dbInfos = DBSystemHelper.GetAllDbSysInfos(dbIP, user, pwd);
            for (int i = 0; i < dbInfos.Length; i++)
            {
                if (dbInfos[i].Name == dbName)
                {
                    return(true);
                }
            }

            return(false);
        }