LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

fetch combo box value

Hi,

I have a long SQL string, in which a user selected value from a combo box should be passed in several lines. 

I could use Concatenate to combine the combo box value with other part of SQL string but since the string is long and the combo value is supposed to appear several times in between I want to preferably avoid this method. Is there any way to catch the combo box selected value in a text way programming so to I give it in the SQL string? 

 

Cheers

 

0 Kudos
Message 1 of 5
(1,156 Views)

Hi Hasamon,

 


@Hasamon wrote:

I have a long SQL string, in which a user selected value from a combo box should be passed in several lines. 

I could use Concatenate to combine the combo box value with other part of SQL string but since the string is long and the combo value is supposed to appear several times in between I want to preferably avoid this method. Is there any way to catch the combo box selected value in a text way programming so to I give it in the SQL string? 


  • What about providing an example (VI) with some input values and an expected output value?
  • What's wrong with ConcatenateStrings?
  • What is "catching a combobox value"? Do you mean to read the combobox by using a wire from its terminal?
  • What is a "text way programming"?
  • What about using FormatIntoString to format a string?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(1,148 Views)

@Hasamon wrote:

but since the string is long and the combo value is supposed to appear several times in between


This just screams "Use Format String" to me.  You can use something like "%1$s" to repeat using the same input (the first value in this example).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 5
(1,139 Views)

@ 

Thanks, I was looking for something like this. But using this format, where should I replace my input?

Could you elaborate it a little bit? 

For example, given the below query:

 

SELECT

*

From dbo.RESULT

WHERE RESULT.Value1 > X

 

If I want to pass value X as an input, how should I rewrite this string?

 

 

0 Kudos
Message 4 of 5
(1,068 Views)

You just replace the "X" with the format.  Assuming your value is an integer, your example string would just be:

 

SELECT

*

From dbo.RESULT

WHERE RESULT.Value1 > %d


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 5
(1,037 Views)