[求助]关于一个修改,更新的问题
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.ClickDim intPosition As Integer
intPosition = objCurrencyMannager.Position
sqlstr = "UPDATE Prod_Stocks " & "SET Quan= '" & Me.txtStock.Text & "'"
UpdateData(sqlstr)
End Sub
Public Function UpdateData(ByVal sqlstr As String) As Boolean
Dim objCommand As SqlCommand = New SqlCommand
Try
objSqlConnection.Open()
objCommand.Connection = objSqlConnection
objCommand.CommandText = sqlstr
objCommand.CommandType = CommandType.Text
objCommand.ExecuteNonQuery()
objSqlConnection.Close()
Catch
MsgBox("错误号:" & Err.Number & "错误描述:" & Err.Description)
Return False
End Try
Return True
End Function
运行后,数据库中的字段为Quan的值全变(一整列都变了),我希望只改变数据库中,当前行的Quan的值(当前一行的值),大家看看,帮帮忙。谢谢了。