dataSet 過濾

            Maticsoft.BLL.ProductsBLL pdBLL = new Maticsoft.BLL.ProductsBLL();
            DataSet ds = new DataSet();
            ds = pdBLL.GetTop6List();
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                ds.Tables[0].Rows[i][3] = ds.Tables[0].Rows[i][3].ToString().Replace("~", "..");
            }
            List_Product.DataSource = ds;
            List_Product.DataBind();

 

 

 

SQL語句:

        public DataSet GetTop6List()
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select top 6 ProductsID,ProductsName,ProductsDescripition,ImagesSrc,ClicksNo,CreateDate,Links");
            strSql.Append(" FROM Products order by ProductsID desc");
            return DbHelperOleDb.Query(strSql.ToString());
        }

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章