This is what I use:
DataAdapter = New SqlDataAdapter
DataAdapter.SelectCommand = Command
Console.WriteLine("SQL: " & DataAdapter.SelectCommand.CommandText)
'If using stored procedure this will show the Parameters
For Each objItem In DataAdapter.SelectCommand.Parameters
Console.WriteLine("Parameter: " & objItem.ToString & " = " &
objItem.Value)
Next
On Jan 2, 11:06 am, Chad <[email protected]> wrote:
> When using a sqlDataSource select, insert, or update command text with
> parameters that are filled in from a control on a form, is there a way
> to see the prepared query that will be passed to the database. In
> otherwords I would like to use for debugging purposes the full sql
> command text including values right before it executed against the
> database. Is there a property that will return the query text?
>
> Thanks ...