日期:2014-05-18 浏览次数:20515 次
select 部门1= case department when '部门1' then 部门1 end, 部门2= case department when '部门2' then 部门2 end, 部门3= case department when '部门3' then 部门3 end, 部门4= case department when '部门4' then 部门4 end, department from tables group by department
------解决方案--------------------
DataTable dt = new DataTable();
foreach(gridviewRow grv in gridview.rows)
{
dt.Columns.Add(grv.cells[1].text, typeof(System.String)); 1为此单元格的值,要是控件
dt.Columns.Add(((强行转换成你的控件)grv.fincControl(控件的ID)).text, typeof(System.String));
}