ExecuteXmlReader()

  • Thread starter Thread starter Brett Robichaud
  • Start date Start date
B

Brett Robichaud

Is there no way to have the returned XmlReader automagically close the
SqlConnection when I call Close() on the XmlReader? I am used to
SqlDataReader where this works nicely.

My data layer currently abstracts out the SqlConnection object so the caller
knows nothing of it. If I add support for ExecuteXmlReader it appears I may
need to expose the SqlConnection. Undesirable.

Thoughts?

-Brett-
 
AFAIK there isn't, but I totally agree with you, it's conspicuously absent
and having the CommandBehavior overload would be every bit as natural a fit
as it is with the datareader... For now I think you have to manually close
everything.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top