出于某种原因,我的messageBox没有出现!有人可以帮助我:visual basic - MessageBox不出现
代码:
item = InputBox("What is the item?", "InputBox Test", "Type the item here.")
If item = "shoe" Then
Dim connStr As String = ""
Dim connection As New MySqlConnection(connStr)
Dim READER As MySqlDataReader
connection.Open()
Dim Query As String
Query = "UPDATE table set item = noOfItems+1 where username= '" & Login.txtusername.Text & "'"
COMMAND = New MySqlCommand(Query, connection)
READER = COMMAND.ExecuteReader
If (READER.Read() = True) Then
Query = "select * from table where username= '" & Login.txtusername.Text & " '"
Dim noOfItems As Integer
Dim username As String
noOfItems = READER("noOfItems")
username = READER("username")
MessageBox.Show(username & "- The number of items you have is: " & noOfItems)
End If
Else
MsgBox("Unlucky, Incorrect item. Please see hints. Your score still remains the same")
感谢提前:)
' “因为某些原因”“ - 这听起来像是一个出色的* *的机会,熟悉使用调试器。它允许您在执行代码时逐行执行代码,并观察变量的行为和运行时值。这将允许您确定代码实际采用的逻辑路径,以便您可以看到*为什么*它没有达到您期望的代码行。如果您能向我们提供相关信息,我们可以帮助回答这个“为什么”。但是我们无法为您在计算机上调试您的代码。 – David
调试的能力是***必不可少的***。 – Plutonix