I have collected the values in dataset.
1. first have to all collect one column values in one variable which is in dataset
2. Have to edit that variable
3. edited values have to update in that column which is in dataset
4. display in gridview.
Loading
Santhosh Kumar JayaramanPosted Sep 7, 2012, 8:29 AM
Foreach(DataRow dr in dataSet1.Table[0])
{
dr["col1"]=//set some value
//or if you want to add something to exisitng values, then
dr["Col1"]=Convert.ToInt32(dr["Col1"].ToString())+5;
}
or if you want to assign to some variable.thats also you can do
Foreach(DataRow dr in dataSet1.Table[0])
{
int i=Convert.ToInt32(dr["Col1"].ToString());
dr["Col1"]=i*5;
}