How can pass

how can pass a variable in SQL query
i have a str variable that i want to pass

i am using execute query tried “+variable+” ---- not working

? ----- getting blank (variable passed as parameter)

Hi @manoj_verma1

You need to pass the variable as like below

’"+Yourvar+"'

Regards

Hi @manoj_verma1

Try the below query
"Select data From TN Where CN = '" + varClientID + "'"

Regards
Gokul

getting blank response

Can you show your query screenshot @manoj_verma1

Hi @manoj_verma1

Can we see a full query that you re using?

Regards

Have a look on the thread @manoj_verma1

Regards
Gokul

1 Like

Close the double quotes before (’
Like this
“…_No in (’”+argument+"’)"

and try again

Regards
Gokul

yes i tried it giving me error string to be end in double quotes

Hi @manoj_verma1

If possible can we have a query in editable format here so that we can make changes and provide?

Regards

What is the type of argument1?

string

Okay So can you try this,

String.Format("…_No in (’{0}’)",argument)

Hope it will work

Regards
Gokul

getting same error string to be in quotes