/// <summary> /// 在线人数 /// </summary> /// <returns></returns> protected int GetOnlineCount() { DateTime lastM = DateTime.Now.AddMinutes(-15); string strSql = "select cast(COUNT(*) as varchar(5)) from sys_Onlines where UpdateTime>'" + lastM + "'"; string mConn = IConfiguration.getParameter("connectString"); IDBOSQL.IDBO dbo = IDBOSQL.IDBO.getIDBO(mConn); dbo.openDatabase(); string str = dbo.executeSql(strSql); dbo.closeDatabase(); return(int.Parse(str)); }
//tablename 表名 //colnames string[] 列名 //values string[] 值 //strwhere 修改条件 public static bool checkExists(string tableName, string strWhere) { string strSql = "select cast(count(*)as varchar(10)) from " + tableName + " where " + strWhere; string mConn = IConfiguration.getParameter("connectString"); IDBOSQL.IDBO dbo = IDBOSQL.IDBO.getIDBO(mConn); dbo.openDatabase(); string str = dbo.executeSql(strSql); dbo.closeDatabase(); if (int.Parse(str) == 0) { return(false); } else { return(true); } }