While some cases may start of as complex, they sometimes turn out to be caused by something not that complex. As the case always is once you have the solution. So I thought I would share some of the things that I've come across, and hopefully tha

Tag: Data Reader

Short one. This sometimes catches people out. When reading a SqlDataReader and then after the read is done, there is an attempt to use the connection that was used for the reading. The exception thrown is (in this case it is thrown when trying to update a table using the same connection that was…

A short one. You are reading data from a data reader, and sometimes you hit: Invalid attempt to read when no data is present. It may seem obvious, but there have been occasions where this error is reported. When checking the code sample below, it is obvious what is going on, but…