st = "SELECT YearLevel FROM Students WHERE StudentID = " & txtStudentID.Text
da = New OleDbDataAdapter(st, conn)
da.Fill(ds, "Students")
YearLevel = ds.Tables("Students").Rows(0).Item("YearLevel")
st1 = "SELECT TuitionFee, BookFee, MiscellaneousFee, OtherFee FROM Expenses WHERE YearLevel = " & YearLevel
da1 = New OleDbDataAdapter(st1, conn)
da1.Fill(ds1, "Expenses")
所以我有那個代碼,然後我有我的第二個查詢中缺少運算符的錯誤,可能的解決方案是什麼?加入兩個表
'YearLevel'的值是多少?你可以添加一個消息框來查看該值是什麼? –
值爲'1級' – silentstorm21