Having a SqlDataReader object, I am trying to get the timeout of its related command. For example I am using this to create my SqlDataReader:
SqlCommand myCommand = new SqlCommand(query, some_connection);
_reader = myCommand.ExecuteReader();
In run-time using visual debugger I can access to this using :
_reader.Command.CommandTimeout // Visual debugger
No how can I do access this "property" in my code (I would like to expose this as a property for a third party lib)?
Context:
I am accessing the reader from a third library, so actually I just have access to the reader. My question is to understand why I can access the command in the debugger and not as a property? What is the mechanism behind the scene, some property extension, reflection?