I am building a website in ASP.NET 2.0, some description of the page I am working about: ListView displaying a table (of posts) from my access db, and a ListBox with Multiple select mode used to filter rows (by forum name, value=forumId). I am converting the ListBox selected values into a List, then running the following query.
Parameter:
OleDbParameter("@Q",list.ToString());
Procedure:
SELECT * FROM sp_feedbacks WHERE forumId IN ([@Q])
The problem is, well, it doesn't work. Even when I run it from MSACCESS 2007 with the string 1,4, "1","4" or "1,4" I get zero results. The query works when only one forum is selected. (In (1) for instance).
- SOLUTION? So I guess I could use WHERE with many OR's but I would really like to avoid this option. Another solution is to convert the DataTable into list then filter it using LINQ, which seems very messy option.
Thanks in advance, BBLN.