DataReader has rows and data, trying to read from it says “no data is present”

前端 未结 2 1564
你的背包
你的背包 2021-01-19 16:30

I haven\'t used DataReaders in ages (I prefer to use an ORM) but I\'m forced to at work. I pull back the rows, and check that HasRows is true; debugging at thi

2条回答
  •  不要未来只要你来
    2021-01-19 17:30

    Just to clarify the answer, it was using the debugger since expanding the results view calls Read() and therefore it moves past the row. As Marc Gravell said in a comment: Debugger considered harmful

提交回复
热议问题