J
Jim Bancroft
Hi everyone--
I have a one-row DataTable that I need to manipulate. It consists of a
series of three columns of related information. All the columns are
strings. For example--
Col1 Col1Descrip Col1Value Col2
Col2Description Col3Value <etc>
"AUTHOR" "email author" "John" "CC" "the
copyee" "Rebecca"
What I'd like to do is "pivot" the table, so to speak, so that it only has
three columns; one for the field name, the field description, and the value.
The single row I have now would be broken into separate rows of three
columns each. Again, here's an example of what I'd like see in the end:
NewCol NewColDescrip NewColValue
"AUTHOR" "email author" "John"
"CC" "the copyee" "Rebecca"
Is there an optimal way of doing this? I suppose I could create a new
DataTable with three columns, then walk through the original DataRow and
build a new row every three columns along....it just sounds a little
kludgey. I don't know, but I thought I'd ask if there were another, better
way to do it. Thanks for the advice.
I have a one-row DataTable that I need to manipulate. It consists of a
series of three columns of related information. All the columns are
strings. For example--
Col1 Col1Descrip Col1Value Col2
Col2Description Col3Value <etc>
"AUTHOR" "email author" "John" "CC" "the
copyee" "Rebecca"
What I'd like to do is "pivot" the table, so to speak, so that it only has
three columns; one for the field name, the field description, and the value.
The single row I have now would be broken into separate rows of three
columns each. Again, here's an example of what I'd like see in the end:
NewCol NewColDescrip NewColValue
"AUTHOR" "email author" "John"
"CC" "the copyee" "Rebecca"
Is there an optimal way of doing this? I suppose I could create a new
DataTable with three columns, then walk through the original DataRow and
build a new row every three columns along....it just sounds a little
kludgey. I don't know, but I thought I'd ask if there were another, better
way to do it. Thanks for the advice.