各位大哥帮小弟看一下这个代码
Sub Page_Load(sender As Object, e As EventArgs)
Dim Conn As OleDbConnection
Dim Provider = "Provider=Microsoft.Jet.OLEDB.4.0"
Dim Database = "Data Source=" & Server.MapPath( "admin/shop.mdb" )
Conn = New OleDbConnection( Provider & ";" & DataBase )
dim strSql1 = "select * from aclass "
Dim mycommand1 As oledbCommand = New oledbCommand(strSql1, conn)
Conn.Open()
Dim myReader1 As oledbDataReader = mycommand1.ExecuteReader(CommandBehavior.CloseConnection)
While myReader1.Read()
dim contact=contact & "<table><tr><td>" & myReader1.GetValue(1).ToString & "</td>"
dim strSql = "select bclassname from bclass where a1='" & myReader1.GetValue(1).ToString &"'"
Dim mycommand As oledbCommand = New oledbCommand(strSql, conn)
conn.Open()
Dim myReader As oledbDataReader = mycommand.ExecuteReader(CommandBehavior.CloseConnection)
While myReader.Read()
contact=contact & "<td>" & myReader.GetValue(1).ToString & "</td>"
End While
conn.Close()
contact=contact & "</tr></table>"
End While
conn.Close()
System.InvalidOperationException: 连接已经打开(state=Open, Fetching)。