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
Sam HobbsPosted Apr 14, 2012, 4:57 PM
VulpesPosted Apr 14, 2012, 6:57 AM
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;
SenthilkumarPosted Apr 13, 2012, 9:09 PM
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