M
Mrinal Kamboj
Hi ,
I am confused that's is not even correctly mentioned in MSDN , if my
code snippet works , have a look at this :
1. string s = {"1", "2","3"} ;
foreach(string ss in s)
{
ss = "4" ; // Compilation error as foreach loop is Read Only as
// it just associates an Enumerator .
}
Now above example is perfect and that's what MSDN says .
Now try this for any simple DataSet (ds) retrieved from a db .
foreach(DataRow dr in ds.Tables[0].Rows)
{
dr[0] = "Something" ; // Assume string column
dr.AcceptChanges() ; // it works fine at every level , so //
compilation error , no runtime issue
// whcih logically shouldn't be an issue
}
any pointers to help me out on this , can it be a MS issue , i am not
even sure about the reason for differentiating behaviour .
thanks ,
Mrinal
I am confused that's is not even correctly mentioned in MSDN , if my
code snippet works , have a look at this :
1. string s = {"1", "2","3"} ;
foreach(string ss in s)
{
ss = "4" ; // Compilation error as foreach loop is Read Only as
// it just associates an Enumerator .
}
Now above example is perfect and that's what MSDN says .
Now try this for any simple DataSet (ds) retrieved from a db .
foreach(DataRow dr in ds.Tables[0].Rows)
{
dr[0] = "Something" ; // Assume string column
dr.AcceptChanges() ; // it works fine at every level , so //
compilation error , no runtime issue
// whcih logically shouldn't be an issue
}
any pointers to help me out on this , can it be a MS issue , i am not
even sure about the reason for differentiating behaviour .
thanks ,
Mrinal