I have an asp.net webpage with an asp.net gridview with the following query:
SelectCommand="SELECT * from details2 as t2 WHERE (t2.OCC IN ('+ @txtCOUNTRY +') OR t2.DCC IN ('+ @txtCOUNTRY +')) and t2.ac='Y'"
The textbox txtCOUNTRY
value can have the following values (for example):
'AR','ES'
However the parameter @txtCOUNTRY
doesn't seem to be properly, written as the gridview shows nothing.
if I change it to (for example) it works:
SelectCommand="SELECT * from details2 as t2 WHERE (t2.OCC IN ('AR,'ES') OR t2.DCC IN ('AR','ES')) and t2.ac='Y'"
So I can only assume the @txtCOUNTRY
parameter is incorrectly written.
Any ideas ?