创建一个SqlDataReader对象 [英] Creating a SqlDataReader Object
本文介绍了创建一个SqlDataReader对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我完全从各种印刷和在线资源中研究使用SQLDataReader
.
将VB.Net 2008 Express与Sql Server Developer 2008一起使用
Dim 阅读器 As 新 SqlDataReader
Dim 阅读器 As 新建 SqlDataReader()
Dim 阅读器 As 新建 SqlDataReader = 没什么
这些每个都报告为错误.我不明白为什么.
我已经导入了system.data.sqlclient命名空间.
任何人有任何想法吗?
解决方案
删除对System.Data.SqlClient的引用(您只需要对System.Data的引用)并使用以下代码:
导入 System.Data.SqlClient 公共 类 Form1 Dim x As SqlDataReader 结束 类
更多信息此处.
I working exactly from various printed and online sources about using a SQLDataReader
.
Using VB.Net 2008 Express with Sql Server Developer 2008
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?
解决方案
Remove the reference to System.Data.SqlClient (you only need a reference to System.Data) and use the following code:
Imports System.Data.SqlClient Public Class Form1 Dim x As SqlDataReader End Class
More info here.
这篇关于创建一个SqlDataReader对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文