string sql=select id as 序列号, username as 用户名,
case yourItem when 0 then 新部门 when 2 then 旧部门 end as department from abc
case yourItem when 0 then 新部门 when 2 then 旧部门 end as department from abc
解决方案 »
- C#实现列行合并代码,求高手帮忙。具体请看图。
- C# word的一些操作问题
- 服务器端遍历iframe页中的checkbox
- 用C#怎么做到 Excel和SQLServer数据的差???请高手指教!!!
- Excel 反射 后期绑定 问题.
- 如何用C++代码解释C#中的foreach循环?
- 两个web控件radiobutton如何实现互斥,好像没有click事件啊?用selectedchanged好像要死循环了:(
- 100求.net的web下菜单的完全解决方法,含源码和操作方法,急用,先谢谢了。
- 关于VS2005中WebService与IIS的冲突
- 求助正则表达式的电子版,顶者有分
- 请教C#更改默认打印机的方法
- 打开收藏夹时网页自动收缩是用什么方法?
干脆在ItemDataBound里面做得了if(((DataRowView)e.Item.DataItem)["yourItem"].ToString() == "0")
e.Item.Cells(4).Text = "新部门"
else
e.Item.Cells(4).Text = "旧部门"
for(int i=0;i<dg.Items.Count;i++)
{
if(dg.Items[i].Cells[4].Text == "0")
dg.Items[i].Cells[4].Text == "新部门";
else if(dg.Items[i].Cells[4].Text == "4")
dg.Items[i].Cells[4].Text == "旧部门";
}