Instantiate object with private constructor

  • Thread starter Thread starter mrrrk
  • Start date Start date
M

mrrrk

It is not possible to create an instance of a
System.Data.SqlClient.SqlDataReader because it's constructor is Private.
But somehow the ExecuteReader method of SqlCommand manages to create a
reader object.

How is this acheived because I want to emulate this sort of behaviour?

Thanks in advance.
 
mrrrk said:
It is not possible to create an instance of a
System.Data.SqlClient.SqlDataReader because it's constructor is Private.
But somehow the ExecuteReader method of SqlCommand manages to create a
reader object.

How is this acheived because I want to emulate this sort of behaviour?

The constructor isn't private - it's internal.
 
Back
Top