Error 1 'System.Data.SqlClient.SqlDataReader.Friend Sub New(command As System.Data.SqlClient.SqlCommand, behavior As System.Data.CommandBehavior)' is not accessible in this context because it is 'Friend'. C:\Users\ozdel\Documents\bitirme_odevi\anons.aspx.vb
64 13 C:\...\bitirme_odevi\
To second Mikesdotnetting advice the point is that you never need to create the reader yourself using "new" (which is why the constructor is not publicly available). Instead you call a method such as SqlCommand.ExecuteReader that internally creates the reader
and return this newly created reader to your code.
None
0 Points
1 Post
SqlDataReader
Apr 15, 2016 12:21 PM|marina_1996|LINK
Error 1 'System.Data.SqlClient.SqlDataReader.Friend Sub New(command As System.Data.SqlClient.SqlCommand, behavior As System.Data.CommandBehavior)' is not accessible in this context because it is 'Friend'. C:\Users\ozdel\Documents\bitirme_odevi\anons.aspx.vb 64 13 C:\...\bitirme_odevi\
How Can I fix it this error?
All-Star
194511 Points
28081 Posts
Moderator
Re: SqlDataReader
Apr 15, 2016 03:32 PM|Mikesdotnetting|LINK
You haven't shown the offending code, but most likely you are declaring and trying to "new up" a SqlDataReader e.g.:
Change that to remove the New:
All-Star
48570 Points
18081 Posts
Re: SqlDataReader
Apr 15, 2016 03:41 PM|PatriceSc|LINK
Hi,
To second Mikesdotnetting advice the point is that you never need to create the reader yourself using "new" (which is why the constructor is not publicly available). Instead you call a method such as SqlCommand.ExecuteReader that internally creates the reader and return this newly created reader to your code.