DataSet Problem

  • Thread starter Thread starter NewGuy
  • Start date Start date
N

NewGuy

Can anyone tell me why this doesn't work

ds.Tables[0].Rows[0].ItemArray[TITLE] = m_sTitle;
 
Hi NewGuy,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you're trying to modify a cell's value
using ds.Tables[0].Rows[0].ItemArray[TITLE] = m_sTitle. However, this
doesn't work. If there is any misunderstanding, please feel free to let me
know.

This doesn't work, because the ItemArray property returns another instance
of values of that row. So when you assign value to that array, actually
you're not modifying the DataRow object but another instance of object
array. So the changes cannot be seen from the DataSet. You can try to
following instead:

ds.Tables[0].Rows[0][TITLE] = m_sTitle;

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Try this,

ds.Tables[0].Rows[0]["TITLE"] = m_sTitle;

I replaced your TITLE with "TITLE" because I assumed that was the actual
name of the column.

HTH
 
Back
Top