你给@column1 负值就是gcellname。
她发送到数据库服务器就是这样的
select gcellname from xfgcell 
这样查出来的结果当然是上面的那样的!你想要什么样的结果?

解决方案 »

  1.   

    select * from xfgcell where county='宜城'
    前一句在数据库服务器是这样的。这和在查询分析器里面执行的效果一样呀!有什么不同?
      

  2.   

    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)
      

  3.   

    select @column1 from xfgcell 
    当@column1 =gcellname
    相当于: select 'gcellname' from xfgcell