Dynamic SQL on a DataSet

I need to get a dynamically created SQL query to work with a DataSet. I use a DataSet where I store some information from a database file (MS-Access).

Now I want the user to be able to select special filters - and depending on them I create an SQL query, for example:

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

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

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

Therefore, I cannot use the TableAdapter for it. How do you do this?

I have already stumbled upon a Select()table adapter -function where I can determine filter expression, but I'm not quite sure how they should look. Any help there?

+3
source share

Source: https://habr.com/ru/post/1760072/


All Articles