Example #1
0
    //Bind data
    private void BindData(string danwei)
    {
        U_ZCBU  zc1  = new U_ZCBU();
        DataSet ds1  = zc1.GetMyZc11(User.Identity.Name, danwei);
        string  zcid = "";

        if (ds1.Tables[0].Rows.Count > 0)
        {
            for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
            {
                if (i == 0)
                {
                    zcid = ds1.Tables[0].Rows[i]["id"].ToString();
                }
                else
                {
                    zcid = zcid + "," + ds1.Tables[0].Rows[i]["id"].ToString();
                }
            }
        }
        Session["Myzcid"]         = zcid;
        this.GridView1.DataSource = ds1;
        this.GridView1.DataBind();

        zc1.Close();
        ds1.Dispose();
    }