I'm trying to create a string from the values in a list; what I am trying to achieve is the SQL syntax which is used in an update query:
UPDATE TABLE SET COLUMN1 =X WHERE COLUMN2 IN ('A','B','C')
(A,B,C are items in my list.) How can I achieve this?
I tried:
string commaSeparatedList = _list.Aggregate((a, x) => a + ", " + x);
but it creates the list without the apostrophes.
') or 1=1; --. I recommend opening a new question with a higher level overview of what you are doing and asking if there is a better method to do what you want to do.