How can I export GridView.DataSource to datatable or dataset?
GridView.DataSource
I have used below line of code and it works, Try this
DataTable dt = dataSource.Tables[0];