Skip to content
Advertisement

how to insert two select in a select command of a sqldatasource

I have to insert two select in a select command of a sqldatasource that is linked to a dropdownlist but I don’t know how to do it.

I tried it but it doesn’t work:

Advertisement

Answer

It sounds like you just need to do one SELECT statement but with two conditions. You can do it like this:

If you really want to do the two seperate queries then you’ll have the UNION the table together or do two separate subqueries then JOIN them. However this will most likely result in a lot of duplicates.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement