DNX Core 5.0 CS1061 error: "SqlDataReader" does not contain a definition for "Close"

I managed to install System.Data.SqlClient from Nuget, and I can use SqlConnection and SqlDataReader to read. But why does the error say Close () for SqlDataReader for the DNX 5 kernel?

Error DNX Core 5.0 CS1061: "SqlDataReader" does not contain a definition of "Close" and the extension method "Close" accepting the first argument of the type "SqlDataReader" can be found (are you missing the use of directives or assembly references?)

+5
source share
2 answers

Now you should go to RC2.

Such Close methods have been removed in many types, and in most cases you should call Dispose .

+3
source

I'm not sure if this is the correct version of SqlDataReader, but it is similar to the corefx version of SqlDataReader, the Close method is more internal than public, as in the full .NET platform

corefx SqlDataReader.cs

0
source

All Articles