今天使用SqlDataReader读取数据的时候,不能用,而记取全部数据的时候就能用,编辑一条的时候就不行,晕呀!!出现“在没有任何数据时进行无效的读取尝试”错误。
    DataReader是只向下读取信息的
    加上判断即可:
    if (reader.read())
     {
        TextName.Text = reader["names"].ToString();
     } 

相关文章:

  • 2021-06-06
  • 2021-10-22
  • 2022-12-23
  • 2022-12-23
  • 2021-11-10
  • 2021-05-17
猜你喜欢
  • 2021-11-04
  • 2021-11-04
  • 2021-09-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案