后台控制输出table(有数据库)

    pid = Session["pid"].ToString();
        uid = Session.SessionID.ToString();
    //   uid = Session["userid"].ToString();
        string sql1 = "userid='" + uid + "'";
        DataSet ds=bll.GetList(sql1);
  
        test = "<table><tr><td>商品</td><td>个数</td></tr>";
        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        {
       test += "<tr><td align=center>" + ds.Tables[0].Rows[i]["Goodsname"].ToString() + "</td><td align=center>" + ds.Tables[0].Rows[i]["GoodsQuantity"] + "</td></tr>";
            sumprice += Convert.ToInt32(ds.Tables[0].Rows[i]["sumprice"].ToString());
       chanpin  += ds.Tables[0].Rows[i]["Goodsname"].ToString()+" ";
       num += ds.Tables[0].Rows[i]["GoodsQuantity"].ToString() + " ";

        }
        test+="</table>";

posted @ 2010-01-08 16:12  liuwei0214  阅读(338)  评论(2编辑  收藏  举报