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.
 
Back
Top