/// <summary> /// 判断专题库是否存在 /// </summary> /// <param name="Name"></param> /// <returns></returns> public static bool ExistZTDB(string Name) { MySqlParameter parm = new MySqlParameter("?name", Name); if (MySqlDbAccess.ExecuteScalar(CommandType.Text, "select count(*) from st_ztlist where name=?name and isdel=0", parm).ToString() == "0") { return(false); } else { return(true); } }
public static DataTable getBaseData(string _strSid, string _strDbType) { DataTable dt = null; try { string strIsFiled = MySqlDbAccess.ExecuteScalar(CommandType.Text, string.Format("select cfg_stcolumn_filed from cfg_dbtype where dbty='{0}'", _strDbType)).ToString(); string strSql = MySqlDbAccess.ExecuteScalar(CommandType.Text, string.Format(@"SELECT GROUP_CONCAT(CONCAT_WS(' as ',col_name,showname) order by id asc separator ',') as fileds FROM cfg_stcolumn where tb_name='show_base' and {0}=true", strIsFiled)).ToString(); dt = MySqlDbAccess.GetDataTable(CommandType.Text, string.Format("select {0} from show_base", strSql)); } catch (Exception ex) { } return(dt); }
public static int getSysKeyCount(string strWhere) { int nRs = 0; try { if (!strWhere.Trim().Equals("")) { strWhere = " where " + strWhere; } string strSql = string.Format("select count(*) from idx_key {0}", strWhere); nRs = Convert.ToInt32(MySqlDbAccess.ExecuteScalar(CommandType.Text, strSql)); } catch (Exception ex) { } return(nRs); }
public static int getPtDataCount(string strWhere) { int nRs = 0; try { if (!strWhere.Trim().Equals("")) { strWhere = " where " + strWhere; } string strSql = string.Format("select count(*) from {0} {1}", tbShow_base.StrTbName, strWhere); nRs = Convert.ToInt32(MySqlDbAccess.ExecuteScalar(CommandType.Text, strSql)); } catch (Exception ex) { } return(nRs); }