I would like to change programatically the SQL Query of a LYR file. I'm developping in C# using ArcObject.
Actually I'm able to get an instance of IWorkspaceFactory from an opened layer with this code :
IDataLayer dataLayer = (IDataLayer)lyrFile.Layer; IDatasetName datasetName = (IDatasetName)dataLayer.DataSourceName; IWorkspaceFactory wsFactory = datasetName.WorkspaceName.WorkspaceFactory;
But from here I'm stuck. I don't know how to access to the SQL Query. I've read that with ISQLWorkspace I could maybe do something. But, really I'm not sure at all.
The goal here is to create multiple copies of a layer file (lyr), changing only the SQL Query slightly. I need to do so because I do not have enough functionnalities within the "Definition Query" tab to implements different variations of my SQL query.