Update Single cell in datatable with multiple rows ASP.NET C#

mreser

New Member
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\[code\]public void MetricChange() { DataTable dt = ds.Tables["MetricTable"]; int value = http://stackoverflow.com/questions/13720057/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(); } }\[/code\]How would i just update the "Value" column within a single row???
 
Back
Top