Opened datareader
-
Hello, Is there a way to find out if there is an opened data reader associated with a given connection. I searched through all properties of the SqlCommand and it's associated SqlConnection, but I could't find anything is there a way to find out? Thank you!
drinking beer is fun :)
-
Hello, Is there a way to find out if there is an opened data reader associated with a given connection. I searched through all properties of the SqlCommand and it's associated SqlConnection, but I could't find anything is there a way to find out? Thank you!
drinking beer is fun :)
you can check it in sql server query analyser by using this query
SELECT * FROM master.dbo.sysprocesses WHERE DB_NAME(dbid) = 'DATABASE NAME'
Regards, Sylvester G If we don't succeed, we run the risk of failure
-
Hello, Is there a way to find out if there is an opened data reader associated with a given connection. I searched through all properties of the SqlCommand and it's associated SqlConnection, but I could't find anything is there a way to find out? Thank you!
drinking beer is fun :)
Hi I assume you want to do this to prevent the error about Multiple Active Result Sets on one connection by checking if the connection already has an open DataReader, and if it does, closing it. If this is the case set MultipleActiveResultSets = true in your connection string to allow you to have more than one open DataReader on a connection. If it isn't please describe in more detail what you are trying to do.
There are 10 types of people in the world, those who understand binary and those who dont.
-
Hi I assume you want to do this to prevent the error about Multiple Active Result Sets on one connection by checking if the connection already has an open DataReader, and if it does, closing it. If this is the case set MultipleActiveResultSets = true in your connection string to allow you to have more than one open DataReader on a connection. If it isn't please describe in more detail what you are trying to do.
There are 10 types of people in the world, those who understand binary and those who dont.
Indeed that was the reason i was asking for help :) Thank you, regards!
drinking beer is fun :)