Home All Groups Group Topic Archive Search About

Move Column in Datatable?

Author
27 Jun 2006 6:54 PM
Frank
Is there a way to re-order datacolumns? Assume I do a "Select * from (insert
table here)" and insert the return rows into a datatable, so the exact
fieldnames and order of the fields are not known at runtime.

Assume I have to move a column called Duration to appear after the column
EmailAddress but these are the only two columns I know about in the table and
there could be other unknown columns also. I have to keep this data in a
Datatable object if possible since our reporting system takes datatables as
input parameters. I have looked at Dataviews but I am not sure this is going
to get me my desired result.

Any help is much appreciated.

Author
27 Jun 2006 10:20 PM
Brendan Green
Just do a:
    SELECT EmailAddress, Duration from <table_name>


Show quote
"Frank" <Fr***@discussions.microsoft.com> wrote in message
news:083AFA0A-0B26-48C6-9E95-5576F9527FA6@microsoft.com...
> Is there a way to re-order datacolumns? Assume I do a "Select * from
> (insert
> table here)" and insert the return rows into a datatable, so the exact
> fieldnames and order of the fields are not known at runtime.
>
> Assume I have to move a column called Duration to appear after the column
> EmailAddress but these are the only two columns I know about in the table
> and
> there could be other unknown columns also. I have to keep this data in a
> Datatable object if possible since our reporting system takes datatables
> as
> input parameters. I have looked at Dataviews but I am not sure this is
> going
> to get me my desired result.
>
> Any help is much appreciated.

AddThis Social Bookmark Button