Wednesday, 26 March 2014

Open DataReader Error.......

Error:- There is already an open DataReader associated with this command which must be closed first.

Solution:

If we use datareader in if else condition and we close the reader in if condition then also this error occurs so the solution is write below code in your else condition

if (!reader.IsClosed)
                    {
                        reader.Close();
                    }

error solved.....

No comments:

Post a Comment