Hi,
why does the following not work?
DataSet ds = new DataSet();
ds.ReadXml("D:\\test.xml");
ds.Tables[8].Rows[0].ItemArray[0] = "test"; // this assingment does not work.
Before assingnment the value was "XXXXX".
After assingment the value was still "XXXXX", but it shold be "test"
Loading

SenthilkumarRank #387 · 6.5K reputationPosted Apr 13, 2012, 5:09 PM EDT
Try this...
ds.Tables[0].Rows[0]["address"] = "test";
For more info:
http://msdn.microsoft.com/en-us/library/tat996zc(v=vs.80).aspx
http://social.msdn.microsoft.com/forums/en-US/adodotnetdataproviders/thread/04b952fa-95d7-4413-98f8-53c0a57ccb23
VulpesRank #55 · 29.2K reputationPosted Apr 14, 2012, 2:57 AM EDT
Changing an element in this array won't change the corresponding column of the row because there's no binding between the two.
However, if you change the array and then reassign it to the ItemArray property, then it should work:
object[] oa = ds.Tables[8].Rows[0].ItemArray;
oa[0] = "test";
ds.Tables[8].Rows[0].ItemArray = oa;
Sam HobbsRank #107 · 20.5K reputationPosted Apr 14, 2012, 12:57 PM EDT