SqlConnection con = new SqlConnection("server=localhost;database=7daydian;uid=sa;pwd=1234");
string dia = "dianliang";
string sql = "select '"+dia+"' from tongji order by shijian";
SqlCommand com = new SqlCommand(sql, con);
我执行了下 没有结果
应该怎样写啊 在线等 急!
------解决方案-------------------- dia是字段名? string sql = "select " + dia + " from tongji order by shijian"; 这样写
------解决方案--------------------
C# code
string sql = 'select "+dia+" from tongji order by shijian';
------解决方案--------------------