(1) string selectStr = "SELECT * FROM news WHERE cateid=1 order by addtime desc"

解决方案 »

  1.   

    string selectStr = "Select * from news where cateid=1 order by addtime DESC";
    string countStr = "Select count(*) as Total from news where cateid=1";
      

  2.   

    string selectStr = "SELECT * FROM news WHERE cateid=1 order by addtime desc"
      

  3.   

    单引号没问题的
    sql语句好象没问题
    把代码贴出来让大家看看
      

  4.   

    SELECT * FROM news WHERE cateid=1 order by addtime desc
      

  5.   

    (1)
    string selectStr = "Select * from news where cateid='1' order by addtime DESC";
    (2)
    string countStr = "Select count(*) as Total from news where cateid='1'";SQL语句没问题,不论是在SQLServer还是在Oracle中,肯定是你的连接有问题,或程序的其它部分问题,把代码贴出来看看