SqlConnection mySqlCon;
mySqlCon=new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);
SelectCommand="select a.Product_Class_ID,name=replicate('--',a.depth*2-2)+a.name,parentname=c.name from Product_Class a join f_id() b on a.Product_Class_ID=b.Product_Class_ID left join Product_Class c on a.parent=c.Product_Class_ID where a.isvalid=0 order by b.sid";
SqlCommand cmd = new SqlCommand(SelectCommand,mySqlCon);
cmd.Connection.Open();
我想实现的效果是当parentname的在数据库中的值为null时,则给parentname取值为无,有值则按数据库中的值
mySqlCon=new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);
SelectCommand="select a.Product_Class_ID,name=replicate('--',a.depth*2-2)+a.name,parentname=c.name from Product_Class a join f_id() b on a.Product_Class_ID=b.Product_Class_ID left join Product_Class c on a.parent=c.Product_Class_ID where a.isvalid=0 order by b.sid";
SqlCommand cmd = new SqlCommand(SelectCommand,mySqlCon);
cmd.Connection.Open();
我想实现的效果是当parentname的在数据库中的值为null时,则给parentname取值为无,有值则按数据库中的值
解决方案 »
- 在htmld页,如何去访问aspx,要将html中的数据存入ms sql或从ms sql中读到html页面中
- 怎么做到像baidu那样搜索标题的搜索功能?
- Calendar1 用法
- 关于ASP.NET发布后程序的问题只有80分了..高手进来下
- 我的WIN2003装了VS2005后, 发现没有MDM服务.....无法用IIS进行网站调试 -_-
- 奇怪的问题,我WIN2000下做IIS服务器时运行较好的ASP.NET程序,到2003下运行有錯誤
- 薪资 请教
- 无法打开ASP.NET项目
- 如何截取字符
- 水晶报表-----Chart中如何显示多条曲线!!!!!!!高手帮忙!!!
- 我动态添加了一个模板列.里面是一个CheckBox控件.我得不到这个控件的值.而且因为这个DataGrid的列都是动态生成的.它的Item.Count是零.要
- DataGrid怎样使按钮显示和不显示
public string turnToflag(string Flag)
{
switch(Flag)
{
case "0":
return "<font color=red>未公开</font>";
case "1":
return "<font color=blue>公开</font>";
default:
return "<font color=red>状态错误</font>";
}
}供参考
public string turnToflag(string Flag)
{
switch(Flag)
{
case "0":
return "<font color=red>未公开</font>";
case "1":
return "<font color=blue>公开</font>";
default:
return "<font color=red>状态错误</font>";
}
}