I would like to change programatically the SQL Query of a LYR file. I'm developping in C# with ArcObject.
Actually I'm able to get an instance of IWorkspaceFactory from a 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 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 my different variations of my SQL query.
If someone could help me on that one, it would be appreciated.
أكثر...
Actually I'm able to get an instance of IWorkspaceFactory from a 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 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 my different variations of my SQL query.
If someone could help me on that one, it would be appreciated.
أكثر...