如题。 初学者,谢谢!

解决方案 »

  1.   

    if reader.Read() then
        '取值
    end if
      

  2.   

    显示应该还是要while的...
    判断是否为空的话可以用HasRow属性!
      

  3.   

    书上介绍的都是用循环,
    HasRow属性怎么用呀,,,麻烦大家写的详细点,,谢谢啦!!
      

  4.   

    我用的是C#
     1.显示数据:
        if(dr.Read()){}//判断数据是否存在。
        但只可用于"select top 1....." or "select * from where 条件=.."的sql语句
     2.判断是否为空值
       if(dr.IsNull(i)){}//i=select语句中列的位数(从“0”开始) 
      

  5.   

    HasRow属性:判断是否有查询的行。
      if(dr.HasRows)
      {
         if(dr.Read())
            {
              ......
            }
      }
      

  6.   

    datagrid,dropdownlist等控件用数据邦定比较方便。datagrid1.databind()
      

  7.   

    我用的是vb
     1.显示数据:
        if(dr.Read()) then   end if//判断数据是否存在。
     2.判断是否为空值
       if(dr.IsDBNull(i)) then  end if//i=select语句中列的位数(从“0”开始)