Jag använder följande för att hämta data till två nestlade repeaters. Men den klagar på "Cannot access a closed Stream." Varför? Cannot access a closed Stream.
Dim conString As String = "xxx"
Dim sql As String = "SELECT * FROM forum_Category; SELECT a.heading, a.mainCategoryID, a.threadsID, a.datetime, a.post, AU.name FROM forum_Threads a INNER JOIN forum_User AU ON a.userID = AU.userID WHERE threadsID IN (SELECT b.threadsID FROM forum_Threads a INNER JOIN forum_Threads b ON a.threadsID >= b.threadsID AND a.mainCategoryID = b.mainCategoryID GROUP BY b.threadsID HAVING (COUNT(1) BETWEEN 1 AND 5)) ORDER BY a.datetime DESC;"
Dim conn As MySqlConnection = New MySqlConnection(conString)
conn.Open()
Dim dsPersonLink As DataSet = New DataSet()
Dim da As MySqlDataAdapter = New MySqlDataAdapter(sql, conn)
da.Fill(dsPersonLink)
dsPersonLink.Relations.Add(New Data.DataRelation("NestThem", dsPersonLink.Tables(0).Columns("mainCategoryID"), dsPersonLink.Tables(1).Columns("mainCategoryID")))
repPersonLink.DataSource = dsPersonLink
repPersonLink.DataBind()
conn.Close()