select count(*) as co from Score
麻烦你们了,帮小弟解释一下上面这句的意思,我要用DataList分页
还有这句:
 if(dr.Read()) 
   { 
   intCount = Int32.Parse(dr["co"].ToString()); 
   } 
   else 
   { 
   intCount = 0; 
   } 
谢谢了

解决方案 »

  1.   

    select count(*) as co from Score
    ====
    很简单的啊.得到score这个表中的总行数.放到列名为co的列下
      

  2.   

    if(dr.Read()) 
       { 
       intCount = Int32.Parse(dr["co"].ToString()); 
       } 
       else 
       { 
       intCount = 0; 
       } dr是一个datareader,如果dr中有值将上面得到的总行数的值赋给intCount,如果没有将intCount归0.
      

  3.   

    if(dr.Read()) //判断是否可以读
       { 
       //把读出的内容转化为整数,存到intcount中
       intCount = Int32.Parse(dr["co"].ToString()); 
       } 
       else 
       { 
       //读取不成功,设0值
       intCount = 0; 
       }
      

  4.   

    intCount = Int32.Parse(dr["co"].ToString()); 
    1为bhwhy(苏秦) 所说;Parse(dr["co"].ToString())
    得到查询结果,为string类型;
    Int32.Parse(dr["co"].ToString())把string转换成int类型
    intCount = Int32.Parse(dr["co"].ToString()); 
    赋值给intCount 
      

  5.   

    嘿嘿,好快,小弟谢过了,呵呵,我喜欢。NET,真的谢谢你们