There is already open Data Reader which is to be closed first....(in .net2.0 & sqlserver2000) RRS feed

  • Question

  • Hi.....


    In my application ....i want to acess database for every 30 secs so my application is calling paarticular stored procedure ...


    in which datareader is used.


    iam closing the datareder and disposing it.

    but sometimes i am getting invalid operation exception saying tat


    "There is already open Data Reader which is to be closed first...."


    I am using .net framework 2.0   and sqlserver2000....


    can anyone l;ook after tis...




    Prabhu R

    Wednesday, August 1, 2007 8:56 AM

All replies

  • Could you post any of the code?  It's difficult to determine without looking at how you have your code structured.  Thanks.

    Wednesday, August 1, 2007 3:00 PM
  • Noting spcl code


    iam havng comon connection thru out my application which ll b initalized on application start ..


    and it is open thru out my application


    just making new cmnds and executing the stps thru cmdobj.executereader


    its wrking normmaly fine


    but in some time its thrwng execption ..


    i searched thr u net thy mentioned tat ....


    some times eventhough reder is closed ..the connection still reminds the previous executed cmd ..bcz of tis the prob arises..


    but thy said tis prob has been solved n .net1.0 service pack 2 ..


    but iam using .net 2.0 ...


    i am facing tis prob...


    can u plz look afer tis..


    may be due to improper updae of .net version ....?

    Wednesday, August 1, 2007 3:35 PM