I have the following code:
For some reason or another, it is generating the exception "Invalid attempt to call Read reader is closed". Can someone help me to solve it? I have no idea why it is generating this exception as I am closing the connection after reading the contents of the reader.
It is generating the exception on this line:
while (rdr.Read())