Use the below code to convert SqlDataSource into a DataTable.
private DataTable ConvertToDataTable(SqlDataSource sd)
{
System.Data.DataView dv = new System.Data.DataView();
System.Data.DataTable dtExcel = new System.Data.DataTable();
dv = (System.Data.DataView)sd.Select(DataSourceSelectArguments.Empty);
dtExcel = dv.ToTable();
return dtExcel;
}