How would i go about updating a single cell in a row so for example Row[0] i want to update the column “Value” with its current value +1. This is code i have which selects the single row but the Value updates with all the column “Value” data then +1
public void MetricChange()
{
DataTable dt = ds.Tables["MetricTable"];
int value = dt.AsEnumerable().Sum(r1 => r1.Field<int>("Value"));
if (Access.Checked)
{
ds.Tables["MetricTable"].Rows[0]["Value"] = value +1;
//ds.Tables["MetricTable"].Rows[1]["Value"] = value - 1;
Chart2.DataSource = ds.Tables["MetricTable"];
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
How would i just update the “Value” column within a single row???
This is how you do it 😛
Then Update the row by this
ds.Tables["MetricTable"].Rows[0][1] = val