Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I working exactly from various printed and online sources about using a SQLDataReader.

Using VB.Net 2008 Express with Sql Server Developer 2008
VB
Dim reader As New SqlDataReader
Dim reader As New SqlDataReader()
Dim reader As New SqlDataReader = Nothing

Each of these report as an error. I don't understand why.
I've got the system.data.sqlclient name space imported.

Anyone have any ideas?
Posted
Updated 4-Dec-09 11:33am
v2

1 solution

Remove the reference to System.Data.SqlClient (you only need a reference to System.Data) and use the following code:
VB
Imports System.Data.SqlClient
Public Class Form1
    Dim x As SqlDataReader
End Class

More info here.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900