Docs: Why is the SqlDataReader not disposed in this example?

Created on 12 Jun 2018  Â·  3Comments  Â·  Source: dotnet/docs

Why is the SqlDataReader not disposed in this example? I thought that it should be enclosed in a using statement or disposed after using it.

(If needed I can pull an edit)


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Area - API Reference

Most helpful comment

@mjwills You're correct that Dispose calls Close (although the inverse is not true - Close does not call Dispose).

All 3 comments

Thanks @FrancescoBonizzi. @douglaslMS can you look at this issue?

Does reader really need to be Closed and Disposed, as shown in this sample?

@mjwills You're correct that Dispose calls Close (although the inverse is not true - Close does not call Dispose).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

UweKeim picture UweKeim  Â·  3Comments

LJ9999 picture LJ9999  Â·  3Comments

skylerberg picture skylerberg  Â·  3Comments

LJ9999 picture LJ9999  Â·  3Comments

Manoj-Prabhakaran picture Manoj-Prabhakaran  Â·  3Comments