Hi I would like to change the value of a datarow in my datatable (DT) by using a numerical box which is set at 0 and moves up/down by 1 increments. I have tried the following but it seems unable to add the box value to the previous values. ie if the datarow value is 100 and i click on the numerical box is should read 101 or 99

Private Sub NumericUpDown1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NumericUpDown1.ValueChanged

        Dim Update As NumericUpDown = sender

        For Each row As DataRow In Form1.dt.Rows
            row("Update") =  + Update.Value
        Next

    End Sub

row("Update") = + Update.Value assigns the value of Update to the row's "update" cell.

try this instead:

r("update") = CInt(r("update")) + NumericUpDown1.Value

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.