Note that there are some explanatory texts on larger screens.

plurals
  1. POc# parameter values to string?
    primarykey
    data
    text
    <p>ok, I'm sure i'm not the only one that has wondered this =)</p> <p>In a nutshell, is it possible using VisualStudio to convert:</p> <pre><code>string a1, string a2, string a3, string a4, string a5, string a6 </code></pre> <p>into a string sorta like:</p> <pre><code>"'value1', 'value2', 'value3', 'value4', 'value5', value6'" </code></pre> <p>(don't worry about the exact formatting, i can handle that myself)?</p> <p>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 </p> <p><strong>EDIT</strong> (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:</p> <pre><code>public static void MethodCreatedByLINQ2Sql(string param1, string param2, string param3, ...) { context.mystoredprocedure(param1, param2, param3...); //&lt;---breakpoint } </code></pre> <p>I want to somehow (without having to specify each param), print out a delimited string that i can cut &amp; paste into SSMS2008 (trying to save time) to build a string like this</p> <pre><code>exec dbo.mystoredprocedure [['value1', 'value2', 'value3'......]] &lt;--- pasted value from VisualStudio </code></pre> <p>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.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload