1.First problem in your code is that you are using data from database without to use pagination, and this for huge amount of data creates big problem in web application.
2.The second problem, that is also related with the first one, is that you are caching all datatable with the huge amount of data inside into the view state and in this all huge amount of data are sending between the postbacks (from browser to the web server). You don't need that because you have all data into the database and you can read them directly from your code (that is running on the web server).
3.To solve all your problem you should implement pagination in your grid view and at the export to excel time to read the huge amount of data directly from the database in your code behind.
You could find details about grid view and pagination in my next article (and the provided source code):
Advanced ASPX GridView Pagination and Data Entities[
^]