using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

public partial class WebMain_Product_IsHot : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        this.databind();
    }
    public void databind()
    {
        int count = Convert.ToInt32(xmlwebconfig.GetXMLvalue("pro", "index", "ish", "cou"));//此处设置个数
        SqlConnection conn = CDatabase.wtoconn();
        conn.Open();
        SqlCommand smd = new SqlCommand("select top "+count+" * from ProductInfo  where IsHot='y' and ISPublished='y' order by AddDate desc", conn);
        int i = 0;
        SqlDataReader sdr = smd.ExecuteReader();
        if (sdr.HasRows)
        {
            this.ishot.DataSource = sdr;
            this.ishot.DataBind();
            this.ishot.RepeatColumns = Convert.ToInt32(xmlwebconfig.GetXMLvalue("pro", "index", "ish", "hh"));
            
            sdr.Close();
            conn.Close();
        }
        else
        {
            Label l1 = new Label();
            l1.Text = "暂无数据";
        }
    }

}
