Raw SQL sent to SQL Server from .NET on stored procedure call
- by Jeff Meatball Yang
Is there a way to get the raw text that is sent to SQL Server, as seen in SQL Profiler, from the ADO.NET call?
using(SqlConnection conn = new SqlConnection(connString)) {
SqlCommand cmd = conn.CreateCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "GetSomeData";
cmd.Parameters.Add("@id").Value = someId;
…