这是我的编码部分...我想要的是当我单击按钮时,数据库中的值将被添加到文本框中。但是当我单击按钮时,我得到的是文本框中的值直接替换为数据库中的新值。有人可以帮我解决这个问题吗?
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
txtShowDescrip.Text &= cmbDescrip.SelectedItem & ","
Dim conn As OleDbConnection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=SDP_DB.accdb")
Dim str As String
Dim dr As OleDbDataReader
Dim cmd As OleDbCommand
Dim total As Integer = 0
conn.Open()
str = "Select * From ChargeTable Where Description='" & cmbDescrip.Text & "'"
cmd = New OleDbCommand(str, conn)
dr = cmd.ExecuteReader
dr.Read()
If dr.HasRows = True Then
total += dr.Item("PriceRate")
txtShowRate.Text = "$" & total
End If
dr.Close()
conn.Close()
End Sub