السلام عليكم
عندي مشكلة في SqlDataReader ولا ادري ما الحل
يعطيني هذه المسج
BC30390: 'System.Data.SqlClient.SqlDataReader.Private Sub New(command As System.Data.SqlClient.SqlCommand, behavior As System.Data.CommandBehavior)' is not accessible in this context because it is 'Private'
الكود هو :
Dim conn As New SqlConnection(ConfigurationManager.ConnectionStrings("اسم الكونيكشن").ConnectionString)
Dim cmd As New SqlCommand()
cmd.Connection = conn
Dim sql As New SqlCommand
sql.Connection = conn
Dim reader As New SqlDataReader
conn.Open()
reader = cmd.ExecuteReader()جربت كتابة الكود بطريقة ثانية واعطاني نفس الخطأ
Dim mySqlConnection As String = "كونيكشن للداتا بيس" Dim cmd As String = "جملة SQL" Dim conn As New SqlConnection(mySqlConnection) Dim mycommand = New SqlCommand(cmd, conn) Dim reader As New SqlDataReader conn.Open() reader = mycommand.ExecuteReader()
نسخت الخطأ وحطيته في محرك البحث قوقل وما لا لقيت اي نتيجة
ما الحل؟؟؟