<?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 Changing the SqlQuery of a layer in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/changing-the-sqlquery-of-a-layer/m-p/1568034#M12411</link>
    <description>&lt;P&gt;C#&lt;/P&gt;&lt;P&gt;Hi, I am trying to change the&amp;nbsp;SqlQuery in my layer and have it update to include my new fields.&lt;/P&gt;&lt;P&gt;var layer = map.Layers.First(layer =&amp;gt; layer.Name == "name");&lt;BR /&gt;var conn = layer.GetDataConnection() as CIMSqlQueryDataConnection;&lt;/P&gt;&lt;P&gt;////Changing the query&lt;BR /&gt;conn.SqlQuery = "select * from " + conn.SqlQuery.Split(" from ").Last();&lt;BR /&gt;layer.SetDataConnection(conn, true);&lt;/P&gt;&lt;P&gt;My goal is to have all my new fields displayed in the table view.&lt;/P&gt;&lt;P&gt;The fields are not recalculated by SetDataConnection.&lt;/P&gt;&lt;P&gt;Is there a way to always view all my fields?&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;Tommy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 12 Dec 2024 19:08:49 GMT</pubDate>
    <dc:creator>TommyBouchard</dc:creator>
    <dc:date>2024-12-12T19:08:49Z</dc:date>
    <item>
      <title>Changing the SqlQuery of a layer</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/changing-the-sqlquery-of-a-layer/m-p/1568034#M12411</link>
      <description>&lt;P&gt;C#&lt;/P&gt;&lt;P&gt;Hi, I am trying to change the&amp;nbsp;SqlQuery in my layer and have it update to include my new fields.&lt;/P&gt;&lt;P&gt;var layer = map.Layers.First(layer =&amp;gt; layer.Name == "name");&lt;BR /&gt;var conn = layer.GetDataConnection() as CIMSqlQueryDataConnection;&lt;/P&gt;&lt;P&gt;////Changing the query&lt;BR /&gt;conn.SqlQuery = "select * from " + conn.SqlQuery.Split(" from ").Last();&lt;BR /&gt;layer.SetDataConnection(conn, true);&lt;/P&gt;&lt;P&gt;My goal is to have all my new fields displayed in the table view.&lt;/P&gt;&lt;P&gt;The fields are not recalculated by SetDataConnection.&lt;/P&gt;&lt;P&gt;Is there a way to always view all my fields?&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;Tommy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 19:08:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/changing-the-sqlquery-of-a-layer/m-p/1568034#M12411</guid>
      <dc:creator>TommyBouchard</dc:creator>
      <dc:date>2024-12-12T19:08:49Z</dc:date>
    </item>
  </channel>
</rss>

