Change Query for Query Layer with code

Discussion created by jamasigEsri on Dec 19, 2012
Latest reply on Oct 8, 2018 by SEria-esristaff
i currently have projects that add a map layer from our sql postgres (Postgis) to a project.

my problem is how to change the connection of datasource (connection with postgres) by code (arcobject .net).

i think taht i shoud get the query of the query layer and relodit by the new connection with the new parametrs

but how can i get the query for the query layer to do that?

would anyone have any code they could share to show how someone would use .?