Out of range error on SqlDataReader

前端 未结 2 959
礼貌的吻别
礼貌的吻别 2021-01-20 18:19

I\'m using a SqlDataReader and get this exception when trying to read a column...

System.IndexOutOfRangeException: record

2条回答
  •  不要未来只要你来
    2021-01-20 18:43

    In my case this error was because I was accidentally executing two select statements in my command text. I had two separate output results and the first output didn't contain the column name I was reading and hence the error.

提交回复
热议问题