|
|
|
start date: Thu, 23 Aug 2007 08:58:41 +0300,
posted on: microsoft.public.dotnet.framework.aspnet.webcontrols
back
| Thread Index |
|
1
Janne Lepola
|
|
2
Janne Lepola
|
how to debug SQL-statements?
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
Date:Thu, 23 Aug 2007 08:58:41 +0300
Author:
|
Re: how to debug SQL-statements?
Janne Lepola wrote:
> 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
Date:Thu, 23 Aug 2007 09:25:19 +0300
Author:
|
|
|