M
moondaddy
Using c# 3.5, I have a dataset (not strongly typed) where all the table
column names are a, b, c, etc. like the sample below. I need to rename the
table columns into something more user friendly such as ID, Name, StartDate,
etc... Also, this is something that will happen over and over with many
different datasets and some of them will be rather large such as 40 column
and 1000 rows. therefore, I want to find the most efficient way to do this.
1) Is there a way to simply rename the table columns when the datatable
already has data in it?
2) Is it possible to create a new dataset and map the columns such as col.a
= col.ID, col.b = col.Name, etc.. and then do a import or merge?
3) or do I have to create the new dataset and manually loop through each
column of each row of the first dataset and set each value into the new
dataset?
4) or is there another better way?
Thanks!
<ds>
<tbClient>
<a>1</a>
<b>test1</b>
<c>01/01/2008</c>
<d>66 Treescape Circle</d>
<e>1</e>
<f>123.000</f>
<g>1</g>
</tbClient>
</ds>
column names are a, b, c, etc. like the sample below. I need to rename the
table columns into something more user friendly such as ID, Name, StartDate,
etc... Also, this is something that will happen over and over with many
different datasets and some of them will be rather large such as 40 column
and 1000 rows. therefore, I want to find the most efficient way to do this.
1) Is there a way to simply rename the table columns when the datatable
already has data in it?
2) Is it possible to create a new dataset and map the columns such as col.a
= col.ID, col.b = col.Name, etc.. and then do a import or merge?
3) or do I have to create the new dataset and manually loop through each
column of each row of the first dataset and set each value into the new
dataset?
4) or is there another better way?
Thanks!
<ds>
<tbClient>
<a>1</a>
<b>test1</b>
<c>01/01/2008</c>
<d>66 Treescape Circle</d>
<e>1</e>
<f>123.000</f>
<g>1</g>
</tbClient>
</ds>