Is there anyway to capture the command the Gridview is executing for later use? I have gridview that uses parameters from a few textboxes, so its generating a custom statement. I am wondering is there anyway for me to get that statement either during or after it is executing it, and then returning the results. I need to save it, so that I can populate a CSV file with the data that was returned?
Share
Gridview doesn’t execute commands. Are you hooking it up to a SqlDataSource by chance? Whatever you’re attaching it to, you want to look at the datasource itself as opposed to the gridview when looking for a select event to hook in to.
There are a couple ways you could “export” to csv from a GridView and/or a specific datasource if you want to. Can you tell us a bit more about your requirements?
@mfredrickson has a good suggestion too. If you’re not getting the answer you want by watching the application, you can always get a definitive answer from the database itself…