asp.net 提示说OleDbconnection未定义类型 15

PublicSubbind()DimmystrAsString=_ConfigurationManager.AppSettings("myconnstring")Dimm... Public Sub bind()
Dim mystr As String = _
ConfigurationManager.AppSettings("myconnstring")
Dim myspl As String = "SELECT student.学号,student.姓名," & _
"score.课程名,score.分数,student.班号 " & _
"FROM student,score " & _
"WHERE student.学号 =score.学号 " & _
"ORDER BY student.学号"
Dim myconn As New OleDbconnection()
myconn.ConnectionString = mystr
myconn.Open()
Dim myds As New Dataset()
Dim myda As New OleDbDataAdapter(mysql, myconn)
myda.Fill(myds, "student")
GridView1.DataSource = myds.Tables(0)
GridView1.DataBind()
myconn.Close()
End Sub
打得一个事件可一直提示里面OleDbconnection,Dataset未定义类型,跟书上打的一样,也不知道到底哪里错了
展开
 我来答
huangpeng0419
推荐于2016-05-31 · TA获得超过357个赞
知道小有建树答主
回答量:569
采纳率:100%
帮助的人:301万
展开全部
第一:有买有添加引用
system.data
system.configuration

第二: Dim myspl As String =
Dim myda As New OleDbDataAdapter(mysql, myconn)

myspl != mysql

Imports System.Configuration
Imports System.Data.OleDb

Module Module1

Sub Main()

End Sub

Public Sub bind()
Dim mystr As String = _
ConfigurationManager.AppSettings("myconnstring")
Dim mysql As String = "SELECT student.学号,student.姓名," & _
"score.课程名,score.分数,student.班号 " & _
"FROM student,score " & _
"WHERE student.学号 =score.学号 " & _
"ORDER BY student.学号"
Dim myconn As New OleDbConnection()
myconn.ConnectionString = mystr
myconn.Open()
Dim myds As New DataSet()
Dim myda As New OleDbDataAdapter(mysql, myconn)
myda.Fill(myds, "student")
GridView1.DataSource = myds.Tables(0)
GridView1.DataBind()
myconn.Close()
End Sub

End Module
懒懒的田螺
2014-12-25
知道答主
回答量:34
采纳率:0%
帮助的人:6.4万
展开全部
15个积分没动力啊
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式