Link to home
Start Free TrialLog in
Avatar of dodgerfan
dodgerfanFlag for United States of America

asked on

What is the proper syntax when trying to insert a variable into a stringbuilder statement

I have this C# statement:
BuildSql.AppendFormat("(UPPER(Field1) like '%{0}%' or UPPER(Field2) like '%{0}%' or UPPER(Field3) like '%{0}%')")

Open in new window

I want to replace the {0} with a string variable passed in. What is the proper syntax for that? Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Snarf0001
Snarf0001
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dodgerfan

ASKER

Perfect. Thank you and thanks for the heads up on the sql injection.