把只有一列的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;
            }

你可能感兴趣的:(字符串)