locked
There is already an open DataReader associated with this Command which must be closed first in Task.Factory RRS feed

  • Question

  • Hello I m using TPL For Executing Method in C#.

    By Executing Below Method . this is Occurring Error : There is already an open DataReader associated with this Command which must be closed first

    Task.Factory.StartNew(() =>
    
                    Print()
                        );

    But  without using Task , it is running fine

    Print();


    Prem Shah

    Sunday, December 13, 2015 9:03 AM

All replies

  • there just has only one line code?

    How About other codes surround the code?


    DON'T TRY SO HARD,THE BEST THINGS COME WHEN YOU LEAST EXPECT THEM TO.

    Friday, December 18, 2015 12:08 PM