SQL “SELECT IN (Value1, Value2…)” with passing variable of values into GridView
问题 I have a strange encounter when creating a GridView using SELECT..WHERE..<field> IN (value1, val2...) . In the "Configure datasource" tab, if i hard code the values SELECT .... WHERE field1 in ('AAA', 'BBB', 'CCC') , the system works well. However, if I define a new parameter and pass in a concatenated string of values using a variable; be it a @session, Control or querystring; e.g. SELECT .... WHERE field1 in @SESSION the result is always empty. I did another experiment by reducing the