Good morning,
I have an ASPX page with an UpdatePanel containing a Gridview and SqlDataSource control. In the SqlDataSource control I specify an InsertCommand. I would like to be able to read the InsertCommand that my page will send to the SQL database. Reading the following
mySqlDataSource.InsertCommand
in code-behind gives me the InsertCommand with @parameters rather than the actual value for each parameter that will be sent to SQL.
Is there a way to read the final InsertCommand that will actually be sent to the database for execution?
EDIT: Please note, my question could apply to Select, Update, Insert or any command that is sent from my ASPX page to SQL. The command must be converted to a language that SQL can interpret and execute and that is the very version of the command that I am trying to read.
Thank you.
I guess you should subscribe to the Inserting event of your DataSource.
Then, in your Inserting_Handler, you may browse the your DataSource.InsertParameters Collection
Hope this will help