select * from xfgcell where county='宜城' 前一句在数据库服务器是这样的。这和在查询分析器里面执行的效果一样呀!有什么不同?
parameters don't work on the select partstring s = "gcellname" string sql = string.Format("select {0} from from xfgcell", s); mycommand=new sqlcommand(sql,myconnection)
select @column1 from xfgcell 当@column1 =gcellname 相当于: select 'gcellname' from xfgcell
前一句在数据库服务器是这样的。这和在查询分析器里面执行的效果一样呀!有什么不同?
string sql = string.Format("select {0} from from xfgcell", s);
mycommand=new sqlcommand(sql,myconnection)
当@column1 =gcellname
相当于: select 'gcellname' from xfgcell