我想显示我想选择的内容,但我只得到 1 行。lz怎么解决?我只得到第一行数据,但是当我在第二轮中执行 do while 时,它会跳过循环并结束该过程。
ListView1.Items.Clear() SQLstring = "SELECT * From record WHERE member_code like '" & u1 & "'" SQLConnection.Open() SQLcommand = New MySqlCommand(SQLstring, SQLConnection) SQLdatareader = SQLcommand.ExecuteReader() 执行 SQLdatareader.Read() a = (SQLdatareader.Item("book_code").ToString()) b = (SQLdatareader.Item("member_code").ToString()) c = (SQLdatareader.Item("book_status").ToString()) d = (SQLdatareader.Item("Borrow_date").ToString()) f = (SQLdatareader.Item("Due_date").ToString()) SQLdatareader.Close() SQLcommand.Dispose() SQLConnection.Close() SQLstring = "SELECT * From book WHERE book_code like '" & a & "'" SQLConnection.Open() SQLcommand = New MySqlCommand(SQLstring, SQLConnection) SQLdatareader = SQLcommand.ExecuteReader() 执行 SQLdatareader.Read() g = (SQLdatareader.Item("book_name").ToString()) h = (SQLdatareader.Item("book_writer").ToString()) i = (SQLdatareader.Item("book_year").ToString()) 环形 将 SQLlist 调暗为 ListViewItem = ListView1.Items.Add(g) SQLlist.SubItems.Add(h) SQLlist.SubItems.Add(i) SQLlist.SubItems.Add(d) SQLlist.SubItems.Add(f) 如果 dtNow > f 那么 暗淡fine_amount = f.Subtract(dtNow) SQLlist.SubItems.Add(fine_amount) 别的 SQLlist.SubItems.Add("0") 万一 环形 SQLdatareader.Close() SQLcommand.Dispose() SQLConnection.Close() 结束子