Why can't I do a foreach on this typed row?

  • Thread starter Thread starter Ray Stevens
  • Start date Start date
R

Ray Stevens

I am trying to do something like this, but getting a compile error:

FldOrderTxn.fldOrderRow orderRow = fot.fldOrder.NewfldOrderRow();

orderRow.FMCO_USER_ID = ds.Tables[0].Rows[0]["FMCO_User_ID"].ToString();
orderRow.SEQ = 1;

foreach (DataColum dc in orderRow)
{
orderRow[dc.ColumnName] =
ds.Tables[0].Rows[0][dc.ColumnName].ToString();
}

Is this doable?
 
Ray Stevens said:
I am trying to do something like this, but getting a compile error:

FldOrderTxn.fldOrderRow orderRow = fot.fldOrder.NewfldOrderRow();

orderRow.FMCO_USER_ID = ds.Tables[0].Rows[0]["FMCO_User_ID"].ToString();
orderRow.SEQ = 1;

foreach (DataColum dc in orderRow)
{
orderRow[dc.ColumnName] =
ds.Tables[0].Rows[0][dc.ColumnName].ToString();
}

Is this doable?

Maybe because the orderRow is not a collection? Try orderRow.Columns.

Mythran

:)
 
Back
Top