我再次檢查DataReader對象是否有數據有問題嗎? Dim cmd as SqlCommand
Dim drd as SqlDataReader
cmd = New SqlCommand ("SELECT * FROM Stock", conx)
drd = cmd.ExecuteReader()
''HERE I WOULD LIKE TO CHEC
我收到以下錯誤; 「已經有一個打開的DataReader與這個Command關聯,必須先關閉它。」 是因爲我在foreach循環中使用了讀取器嗎?或者問題可能是什麼? 問候 BK foreach(Apple a in listApple)
{
....
using (SmartSqlReader reader = Db.CurrentDb.ExecuteReader(sp
你能解釋一下爲什麼我不能在程序中使用兩個datareader? 下面是示例代碼: Private Sub Do_Execute()
Dim conx as SqlConnection
Dim cmd1 as SqlCommand
Dim cmd2 as SqlCommand
Dim drd1 as SqlDataReader
Dim drd2