tags:

views:

31

answers:

1

I have to get a dynamically created SQL-Query to work with a DataSet. I'm using a DataSet where I store some information from the database file (MS-Access).

Now I want the user to be able to select special filters - and depending on them I create a SQL-Query, e.g.:

SELECT * FROM table WHERE x <> 0 AND y >= 10

The problem is, that the parameters are completely dynamic, so it could as well look like this:

SELECT * FROM table WHERE x <= 50 AND y IN (10, 50, 43)

So I can't use a TableAdapter for it. How yould I get this working?

I already came across the Select()-function of a Table adapter where I can define filter expression but I'm not quite sure how they should look like. Any help there?