Acess数据库打开的问题
OleDbCommand 是当前正忙的 Open, Fetching。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.InvalidOperationException: OleDbCommand 是当前正忙的 Open, Fetching。
但是我程序里边只有这一个open()啊
Dim MyOleConnection As New OledbConnection(ConfigurationSettings.AppSettings("connStr"))
Dim MyOleCommand As New OledbCommand
Dim MyRead As OledbDatareader
MyOleConnection.open()
MyOleCommand.Connection = MyOleConnection
MyOleCommand.Commandtext = "SELECT * FROM userA where (name='" &session("name") & "' and password= '" & pswd1.text & "')"
MyRead = MyOleCommand.Executereader
If MyRead.read then
MyOleCommand.commandtext = "update userA set password='" & pswd2.text & "' where (name='" &session("name") & "' and password= '" & pswd1.text & "')"
MyOleCommand.Executenonquery
MyOleConnection.close()
MyRead.close()
MyOleConnection = nothing
MyOleCommand = nothing