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

  • SEARCH
  • Home
  • 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 8522153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:02:07+00:00 2026-06-11T07:02:07+00:00

ok, I’m sure i’m not the only one that has wondered this =) In

  • 0

ok, I’m sure i’m not the only one that has wondered this =)

In a nutshell, is it possible using VisualStudio to convert:

string a1, string a2, string a3, string a4, string a5, string  a6

into a string sorta like:

"'value1', 'value2', 'value3', 'value4', 'value5', value6'"

(don’t worry about the exact formatting, i can handle that myself)?

Background:
I often have functions that calls stored procedures that accept a lot of params, and sometimes (debugging) i need to build the “exec dbo.storedprocname param1, param2….” string and run it directly against the server. Currently i have to manually build the string and i’m hoping there’s an easy way to print it out in the immediate window in VisualStudio

EDIT (By popular demand):
I’m using Linq2SQL (yes, i knwo it’s obsolete) and have 100+ SP’s in it. When I need to debug a function, i put a break inside one of these functions to see what it’s about to pass to the database. So this would be RUNTIME. When it hits the breakpoint:

public static void MethodCreatedByLINQ2Sql(string param1, string param2, string param3, ...)
{
    context.mystoredprocedure(param1, param2, param3...); //<---breakpoint
}

I want to somehow (without having to specify each param), print out a delimited string that i can cut & paste into SSMS2008 (trying to save time) to build a string like this

exec dbo.mystoredprocedure [['value1', 'value2', 'value3'......]] <--- pasted value from VisualStudio

No, i’m not trying to do SQLInjections or anything like that. I’m just trying to save time – some of these SP’s have 20+ params.

  • 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-11T07:02:09+00:00Added an answer on June 11, 2026 at 7:02 am

    Is this what you’re after?

    String paramStr = String.Format("'{0}', '{1}', '{2}', '{3}', '{4}'", a1, a2, a3,a4,a5);

    I should point out that sending strings like this to the DB can result in SQL Injection

    Option 2:

    To print the to the intermediate window you can use this trick:

    1. Create a breakpoint
    2. Right-Click the red dot -> “When Hit”.
    3. In the new screen select the “Print a message” checkbox
    4. In the textbox type the String.Format from above but with a curly brace on each side:

    { String.Format(.....) }

    More about the params you can print in that message: http://msdn.microsoft.com/en-us/library/232dxah7.aspx

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I am reading a book about Javascript and jQuery and using one of the
I know there's a lot of other questions out there that deal with this
Does anyone know how can I replace this 2 symbol below from the string
I need a function that will clean a strings' special characters. I do NOT

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.