<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Change Query for Query Layer with code in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/change-query-for-query-layer-with-code/m-p/585278#M15843</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;does anyone know, how the querylayer itself is created? i need to do exactyl the same as described (change the source of an existing&amp;nbsp;querylayer). so the solution for getting the information of the existing layer is allready provided. but how do i create the new querylayer from the new source?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;george&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Feb 2018 11:21:06 GMT</pubDate>
    <dc:creator>georgandersson</dc:creator>
    <dc:date>2018-02-06T11:21:06Z</dc:date>
    <item>
      <title>Change Query for Query Layer with code</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/change-query-for-query-layer-with-code/m-p/585276#M15841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;i currently have projects that add a map layer from our sql postgres (Postgis) to a project.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;my problem is how to change the connection of datasource (connection with postgres) by code (arcobject .net).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i think taht i shoud get the query of the query layer and relodit by the new connection with the new parametrs&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but how can i get the query for the query layer to do that?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;would anyone have any code they could share to show how someone would use .?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2012 09:18:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/change-query-for-query-layer-with-code/m-p/585276#M15841</guid>
      <dc:creator>jamalhanine</dc:creator>
      <dc:date>2012-12-19T09:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: Change Query for Query Layer with code</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/change-query-for-query-layer-with-code/m-p/585277#M15842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I found the solution for the problem, and i want to share it with you, if never some one has the same problem&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pTable As ITable = featureLayer.FeatureClass&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pDataset As IDataset = pTable&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pQueryTableName As IQueryTableName&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pQueryTableName = pDataset.FullName&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim query As String = pQueryTableName.QueryDescription.Query&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jamal Hanine&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Dec 2012 10:05:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/change-query-for-query-layer-with-code/m-p/585277#M15842</guid>
      <dc:creator>jamalhanine</dc:creator>
      <dc:date>2012-12-20T10:05:14Z</dc:date>
    </item>
    <item>
      <title>Re: Change Query for Query Layer with code</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/change-query-for-query-layer-with-code/m-p/585278#M15843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;does anyone know, how the querylayer itself is created? i need to do exactyl the same as described (change the source of an existing&amp;nbsp;querylayer). so the solution for getting the information of the existing layer is allready provided. but how do i create the new querylayer from the new source?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;george&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Feb 2018 11:21:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/change-query-for-query-layer-with-code/m-p/585278#M15843</guid>
      <dc:creator>georgandersson</dc:creator>
      <dc:date>2018-02-06T11:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: Change Query for Query Layer with code</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/change-query-for-query-layer-with-code/m-p/585279#M15844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Here is some sample code that shows how to create a Query Layer:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IWorkspaceFactory2 workspaceFactory = new SqlWorkspaceFactoryClass();&lt;/P&gt;&lt;P&gt;string connectionString = "dbclient=oracle11g;" + "serverinstance=190.100.100.200/MYMAP;" + "USER=SDE;" + "PASSWORD=SDE";&lt;BR /&gt;ISqlWorkspace sqlWorkspace = workspaceFactory.OpenFromString(connectionString, 0) as ISqlWorkspace;&lt;BR /&gt;IQueryDescription queryDescription = sqlWorkspace.GetQueryDescription("SELECT * FROM SDE.MYTABLE");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ITable table = pSqlWorkspace.OpenQueryClass("TestQueryTable", queryDescription);&lt;BR /&gt;IFeatureClass featureClass = table as IFeatureClass;&lt;BR /&gt;featureLayer.FeatureClass = featureClass;&lt;BR /&gt;axMapControl1.Map.AddLayer(pFeatureLayer as ILayer);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is based on code posted by a user on another forum (&lt;A href="https://code.csdn.net/snippets/229166"&gt;https://code.csdn.net/snippets/229166&lt;/A&gt;).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Oct 2018 18:09:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/change-query-for-query-layer-with-code/m-p/585279#M15844</guid>
      <dc:creator>seria</dc:creator>
      <dc:date>2018-10-08T18:09:06Z</dc:date>
    </item>
    <item>
      <title>Re: Change Query for Query Layer with code</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/change-query-for-query-layer-with-code/m-p/1404083#M20651</link>
      <description>&lt;P&gt;In case it saves anyone else time in the future if they try using that snippet . . .&amp;nbsp; The &lt;A href="https://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#SqlWorkspaceFactory.htm" target="_self"&gt;SqlWorkspaceFactory class doc&lt;/A&gt; says . . .&lt;/P&gt;&lt;P&gt;The &lt;A href="https://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#SdeWorkspaceFactory.htm" target="_self"&gt;SDEWorkspaceFactory&lt;/A&gt;.Open method should be used to make connections to all databases and enterprise geodatabases.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2024 22:30:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/change-query-for-query-layer-with-code/m-p/1404083#M20651</guid>
      <dc:creator>DanNarsavage_IDWR</dc:creator>
      <dc:date>2024-04-01T22:30:40Z</dc:date>
    </item>
  </channel>
</rss>

