how to debug SQL-statements?

J

Janne Lepola

Hi,

I recently changed developing from ASP to ASP.NET and I'm having
problems with accessing SQL-statements built by FormView. For some
reason FormView update-statement doesn't work in some cases (but neither
raises error), so I though I'd like to get response of update-statement
which was sent to SQL-server. I tried using follwing code:

Protected Sub SqlDataSource1_Updating(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.SqlDataSourceCommandEventArgs) Handles
SqlDataSource1.Updating

resultLabel.Text = ""
resultlabel.Text = SqlDataSource1.UpdateCommand

End Sub

unfortunately this code seems to echo only preformatted SQL-update
statement without parameters. Basically update looks like "UPDATE
Something SET SomethingElse = :SomethingElse", while I'm looking for
"UPDATE Something Set SomethingElse = 'user inputted this string, hello
world!'".

How can I access this final SQL-statement?

- Janne Lepola , Finland
 
J

Janne Lepola

Janne said:
Hi,

I recently changed developing from ASP to ASP.NET and I'm having
problems with accessing SQL-statements built by FormView. For some
reason FormView update-statement doesn't work in some cases (but neither
raises error), so I though I'd like to get response of update-statement
which was sent to SQL-server. I tried using follwing code:

Protected Sub SqlDataSource1_Updating(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.SqlDataSourceCommandEventArgs) Handles
SqlDataSource1.Updating

resultLabel.Text = ""
resultlabel.Text = SqlDataSource1.UpdateCommand

End Sub

unfortunately this code seems to echo only preformatted SQL-update
statement without parameters. Basically update looks like "UPDATE
Something SET SomethingElse = :SomethingElse", while I'm looking for
"UPDATE Something Set SomethingElse = 'user inputted this string, hello
world!'".

How can I access this final SQL-statement?

- Janne Lepola , Finland

I'm working with Oracle database, so I cannot use SQL Server -debugging
options as such. Isn't there any way to access compiled statement
through SqlDataSource or FormView -component?

- Janne Lepola
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top