Can not convert an object of type 'System.Collections.Generic.List in type' System.Data.DataSet '?
After making a query for a report, I am saving the data in a list and displaying the data on the screen, plus I have an option to export the data to Excel >, so to not repeat the query I am saving the data in a session.
Session
:
repeater_teste.DataSource = retorno;
Session["Ultimo_Relatorio"] = retorno
In the export option I am doing this (generating error ):
DataSet ds = (DataSet)Session["Ultimo_Relatorio"];
DataGrid dg = new DataGrid();
dg.AllowPaging = false;
dg.DataSource = ds.Tables[0];
dg.DataBind();
I found this article that said it was possible .