把只有一列的dt中内容变成字符串

string Qstr = null;
            foreach (DataRow dr in dt.Rows)//把获取的dt中的Id赋给字符串,用字符串传递
            {
                Qstr += dr["PS_Id"].ToString() + ",";
            }
            //去除字符串后面的“,”
            if (Qstr == null)
            {
                Common.AdCommon.ShowError("该店没有下属店");
            }
            else
            {
                Qstr = Qstr.Remove(Qstr.Length - 1);
                dt = bllPassive.SelectStore(Qstr);
            }
            dt.Columns.Add("xz", typeof(bool));
            foreach (DataRow dr in dt.Rows)
            {
                dr["xz"] = false;
            }
posted @ 2011-05-14 20:05  勇气  阅读(200)  评论(0编辑  收藏  举报