예제 #1
0
        /// <summary>
        /// 查询是否存在列
        /// </summary>
        public bool Exists(string column_name)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select count(1) from " + databaseprefix + "article_attribute_field");
            strSql.Append(" where name=@name ");
            MySqlParameter[] parameters =
            {
                new MySqlParameter("@name", MySqlDbType.VarChar, 100)
            };
            parameters[0].Value = column_name;

            if (DbHelperMySql.Exists(strSql.ToString(), parameters) || DbHelperMySql.ExitColumnName(databaseprefix + "article", column_name))
            {
                return(true);
            }
            return(false);
        }