Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Aug 16, 2007 06:52 AM by Kevin Yu - MSFT
Aug 14, 2007 12:20 PM|LINK
I am exporting the result of a query to excel
if i create a sqladapter and fill my datatable it works fine -- old code
however, if i make a dataview of the sqldatasource and convert that to a datatable it errors
How do you convert a dataview to a datatable
code snippet below fail
then i call the function and it errors
this works fine -- whats the difference
Aug 16, 2007 06:52 AM|LINK
The ToTable() method should create a new DataTable on what the DataView have.
Could you let me know what exception was thrown on which line?
I would suggest you try to check SqlDataSource.DataSourceMode property. Because the Select method returns a DataView object, if the DataSourceMode property is set to the DataSet value; or it will return a IDataReader object, if the DataSourceMode property
is set to the DataReader value. So make sure DataSourceMode has been set to DataSet.