This is a migrated thread and some comments may be shown as answers.

Report DataTable

1 Answer 152 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 01 Feb 2013, 10:37 AM
I have created a report and added a table to the detail section.
I have set the sql datasource of this table at design time. The sql data source is dynamic and can return a different number of columns at run time.
I would like to be able to get (or convert) the sqldatasource into a datatable at run time so I can identify the number of columns and column names returned by the datasource and build the table dynamically.
I have managed to build a dynamic table but I cannot figure out how to convert or access the sql datasources dataset/datatable/rawdata. How do I do this? is it even possible?

Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Hadib Ahmabi
Top achievements
Rank 1
answered on 01 Feb 2013, 01:18 PM
Since you are building your tables programmatically, it is pointless to use SqlDataSource. Simply use SqlDataAdapter and fill the data to a DataTable/Set. 
Tags
General Discussions
Asked by
Mike
Top achievements
Rank 1
Answers by
Hadib Ahmabi
Top achievements
Rank 1
Share this question
or