Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8360491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:28:48+00:00 2026-06-09T11:28:48+00:00

Scenario I am executing a stored procedure using ADO.NET SqlCommand: cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText

  • 0

Scenario

I am executing a stored procedure using ADO.NET SqlCommand:

cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "sp_Trk_GetSuspiciusVisitor";
cmd.Parameters.Add(new SqlParameter("channel","gb"));
cmd.Parameters.Add(new SqlParameter("data", DateTime.Today.AddDays(-1)));
cmd.Connection = conn;

I would like to log the executed sql statement. In this case I would like to log the string:

sp_Trk_GetSuspiciusVisitor 'gb', '2012-08-12'

Question

Is there any property of the SqlCommand or of the SqlConnection classes that does the job?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T11:28:50+00:00Added an answer on June 9, 2026 at 11:28 am

    no, unfortunatelly you would have to loop through all the paramenters to get their values and concatenate it with the command text

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am learning ASP.NET and I have a master-detail scenario using two GridViews in
Here is the scenario. I have built a data wrapper class for executing stored
I have a scenario where a Stored procedure calls several user defined functions inside
I've come across a interesting scenario (at least for me) in a stored procedure.
Here's my scenario: User inputs date range. Stored Procedure runs, which populates other tables
Scenario : I am using a T-SQL stored proc (Sql Server Management Studio) to
Running the same Stored Procedure from C# .Net application over a network gets progressively
Scenario first :- I'm using Entity Framework to do some queries, to build my
Scenario While using the Maven Ant Task artifact:deploy , I'm encountering the error java.lang.OutOfMemoryError:
The scenario I am facing is that I have an ASP.NET web service (.NET

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.