Hello I have created and application which contains a gridview that is populated by an SQL database. I built a function which converts the gridview into an excel file and stores it on the server.
I would just like to know how I can write an executable script(which I will set to run at a certain time on the server) that will access the gridview in the .aspx file containing the gridview and run the convertToExcel() function located in the .cs file attached to the .aspx file and then close.
Thank you,
Fernando Diaz
If it were me, I’d separate out the code that performs the data retrieval for the gridview and the Excel processing into it’s own class library project. Then, with that DLL, createa console application that calls those functions. You can schedule a windows service to execute that .exe daily.
With that said.
To specifically answer your question. You need to create a console application and request the page using an HttpWebRequest
Because it seems you don’t need to read the response, this should be sufficient.