is dynamically changing a datasource possible?

Discussion created by NeoJigglypuff on Jun 27, 2012
I've posted a related question is in the Desktop forums, but hasn't gotten any replies yet. In that case, I would like tackle this in another way, which is dynamically changing a datasource using arcgis js api. Is this possible?

To give some detail, the layers defined in my mapservice are joined with another view through oledb. Will the class QueryDataSource be able to do this, and how?