我希望每次读者阅读时都会将金额列的值添加到lblamount。但是,它只会替换值而不是添加它。
MySqlConn.Open()
Dim query As String
Dim reader As MySqlDataReader
query = "SELECT * FROM services WHERE Service_Name ='" & txtURThirdMolar.Text & "'"
cmd = New MySqlCommand(query, MySqlConn)
reader = cmd.ExecuteReader
If reader.Read Then
Dim amnt As Integer
amnt = reader.Item("Amount")
lblAmount.Text = +amnt
End If
MySqlConn.Close()
答案 0 :(得分:0)
将amnt = reader.Item("Amount")
替换为amnt = amnt + reader.Item("Amount")
.....您也可以将其替换为amnt += reader.Item("Amount")
,这是您的选择......