我想把搜索结果,某列的列名设为空格,语句如下:select a as " " from abc这个语句在SQL里运行没问题。然后绑定到数据源里SqlDataSource1.SelectCommand="select a as " " from abc";这时就不行了,识别不出来,我换了个方法string a = " ";SqlDataSource1.SelectCommand="select a as "" + a + "" from abc";也是不行,大家说应该怎么弄好?
SQL语句中应该是:
select a as ' ' from abc
因此放在代码中也没问题。如果需要双引号:
SqlDataSource1.SelectCommand="select a as \" \" from abc";
或者:
SqlDataSource1.SelectCommand=string.Format("select a as \"{0}\" from abc"," ");