C#多条件查出来的多个DataSet,然后循环将数据整合
private list<string> barlist;
public list<string> barlist
{
get { return barlist; }
set { barlist = value; }
}
dataset dt = new dataset();
dataset dt2 = null;
foreach (string data in help.barlist )
{
dt = dboperatorstd.getdataset("select xxx from xxx where xxx='" + data + "'");
if (dt2 == null)
{
dt2 = dt.copy();
}
else
{
foreach (datarow dtrow in dt.tables[0].rows)
{
datarow m_nrow = null;
m_nrow = dt2.tables[0].newrow();
foreach (datacolumn dccol in dt2.tables[0].columns)
{
m_nrow[dccol.columnname] = dtrow[dccol.columnname];
}
dt2.tables[0].rows.add(m_nrow);
}
}
}
上一篇: 【转载】IIS网站配置不带www域名直接跳转带www的域名
下一篇: 小学文化