Exception thrown: 'System.NotImplementedException' in SQLDataAccess.dll
I am trying to load some data from SQL Server like this:
Imports System.Data.SqlClient
'Imports Microsoft.SqlServer
Public Class Form1
Inherits System.Windows.Forms.Form
'Create ADO.NET objects.
Private myConn As SqlConnection
Private myReader As SqlDataReader
Private results As String
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
'Create a Connection object.
myConn = New SqlConnection("Initial Catalog=Deportes;" &
"Data Source=localhost;Integrated Security=SSPI;")
'Open the connection.
myConn.Open()
'Create a Command object.
Dim strSQL As String = "SELECT TOP FROM [Deportes].[dbo].[LeaguePower]"
Dim myCmd As New SqlCommand(strSQL, myConn)
myReader = myCmd.ExecuteReader()
'Concatenate the query result into a string.
Do While myReader.Read()
results = results & myReader.GetString(0) & vbTab &
myReader.GetString(1) & vbLf
Loop
'Display results.
MsgBox(results)
End
End Sub
When it hits the ExecuteReader command and goes to that function and it fail. It calls the command and then returns the error
Exception thrown: 'System.NotImplementedException' in SQLDataAccess.dll
The program '[12808] SQLDataAccess.exe' has exited with code 3221226525 (0xc000041d).
I got this to learn, and nowhere do they reference having to handle the ExecuteReader command. I thought it was handled by Visual Studio. The connection opens just fine and I can see the tables and the data.
Friend Class SqlCommand
Private strSQL As String
Private myConn As SqlConnection
Public Sub New(strSQL As String, myConn As SqlConnection)
Me.strSQL = strSQL
Me.myConn = myConn
End Sub
Public Property CommandText As String
Public Property CommandType As CommandType
Friend ReadOnly Property ExecuteReader As SqlDataReader
Get
Throw New NotImplementedException()
End Get
End Property
End Class