<?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: Connect and Query Database in Qt Maps SDK Questions</title>
    <link>https://community.esri.com/t5/qt-maps-sdk-questions/connect-and-query-database/m-p/408784#M2057</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Thanks for your feedbacks. Depending on what you would like to achieve, there are a few samples from the ArcGIS Runtime SDK for Qt 10.2 that can help you get started:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://developers.arcgis.com/en/qt/sample-code/local_geodatabase_editing_sample.htm"&gt;http://developers.arcgis.com/en/qt/sample-code/local_geodatabase_editing_sample.htm&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://developers.arcgis.com/en/qt/sample-code/local_query_sample.htm"&gt;http://developers.arcgis.com/en/qt/sample-code/local_query_sample.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for ur answer. But in that examples, just connect to a Arcgis Service with a URL. I wanna connect to a SDEWorkspace, with somes information: DB's server IP, DB's instance, DB's name, usename, password... likely Arcobject .NET or Java. Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Nov 2013 07:33:42 GMT</pubDate>
    <dc:creator>LeAnh1</dc:creator>
    <dc:date>2013-11-22T07:33:42Z</dc:date>
    <item>
      <title>Connect and Query Database</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/connect-and-query-database/m-p/408782#M2055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dear all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I created some tables in my Arcgis Database. Now, I wanna connect to that DB và query inforamtion. I dont see any example talk about this topic. Anyone can show me smal example. Thanks so much!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;P/S: I'm using Esri Runtime QT SDK 10.2, QT 5.1.1, Win 8.1 64bit, Visual Studio 2012.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Nov 2013 00:11:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/connect-and-query-database/m-p/408782#M2055</guid>
      <dc:creator>LeAnh1</dc:creator>
      <dc:date>2013-11-18T00:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: Connect and Query Database</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/connect-and-query-database/m-p/408783#M2056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your feedbacks. Depending on what you would like to achieve, there are a few samples from the ArcGIS Runtime SDK for Qt 10.2 that can help you get started:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://developers.arcgis.com/en/qt/sample-code/local_geodatabase_editing_sample.htm"&gt;http://developers.arcgis.com/en/qt/sample-code/local_geodatabase_editing_sample.htm&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://developers.arcgis.com/en/qt/sample-code/local_query_sample.htm"&gt;http://developers.arcgis.com/en/qt/sample-code/local_query_sample.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Nov 2013 15:38:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/connect-and-query-database/m-p/408783#M2056</guid>
      <dc:creator>JeanneTrieu</dc:creator>
      <dc:date>2013-11-19T15:38:49Z</dc:date>
    </item>
    <item>
      <title>Re: Connect and Query Database</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/connect-and-query-database/m-p/408784#M2057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Thanks for your feedbacks. Depending on what you would like to achieve, there are a few samples from the ArcGIS Runtime SDK for Qt 10.2 that can help you get started:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://developers.arcgis.com/en/qt/sample-code/local_geodatabase_editing_sample.htm"&gt;http://developers.arcgis.com/en/qt/sample-code/local_geodatabase_editing_sample.htm&lt;/A&gt;&lt;BR /&gt;&lt;A href="http://developers.arcgis.com/en/qt/sample-code/local_query_sample.htm"&gt;http://developers.arcgis.com/en/qt/sample-code/local_query_sample.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for ur answer. But in that examples, just connect to a Arcgis Service with a URL. I wanna connect to a SDEWorkspace, with somes information: DB's server IP, DB's instance, DB's name, usename, password... likely Arcobject .NET or Java. Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Nov 2013 07:33:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/connect-and-query-database/m-p/408784#M2057</guid>
      <dc:creator>LeAnh1</dc:creator>
      <dc:date>2013-11-22T07:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Connect and Query Database</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/connect-and-query-database/m-p/408785#M2058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would be interested in the knowing of this answer as well.&amp;nbsp; Can runtime make direct connections to existing geodatabases?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Nov 2013 13:05:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/connect-and-query-database/m-p/408785#M2058</guid>
      <dc:creator>MikhaelTorstveld</dc:creator>
      <dc:date>2013-11-26T13:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: Connect and Query Database</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/connect-and-query-database/m-p/408786#M2059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There is a way to do this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The coding pattern is very similar to what you'll find in the &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/en/qt/sample-code/dynamic_map_layer_sample.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Dynamic Map Layer sample&lt;/A&gt;&lt;SPAN&gt; of the ArcGIS Runtime SDK for Qt sample viewer application.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As demonstrated in that example, you'll need to begin by using the LocalMapService along with an "empty" MPK. It's important that you enable dynamic layers on the LocalMapService as well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;QString dataPath = pathSampleData + "mpks" + QDir::separator() + "mpk_blank.mpk";
m_localMapService = EsriRuntimeQt::LocalMapService(dataPath);

m_localMapService.setEnableDynamicLayers(true);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Create a WorkspaceInfo using the static method "CreateSDEConnection", passing in a workspace ID string and the connection string to the SDE instance. Keep in mind, your client machine where this app is running must have the appropriate client libraries installed for the database you are going to connect to, whether it be SQLServer, Oracle, or Postgres, for example. In this case, we are connecting to a SQLServer database:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"INSTANCE=sde:sqlserver:bedrock4;DATABASE=nongdb;USER=map;PASSWORD=map"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

// Get the WorkspaceInfoSet from the LocalMapService...
EsriRuntimeQt::WorkspaceInfoSet&amp;amp; workspaceInfoSet = m_localMapService.dynamicWorkspaces();


// create a workspace info via the static method according to data type

m_workspaceId = QString("1");
EsriRuntimeQt::WorkspaceInfo workspaceInfo = 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EsriRuntimeQt::WorkspaceInfo::CreateSDEConnection(m_workspaceId, QString("INSTANCE=sde:sqlserver:bedrock4;DATABASE=nongdb;USER=map;PASSWORD=map"));


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; workspaceInfo.setEditable(true);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; workspaceInfoSet.add(workspaceInfo);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_localMapService.setDynamicWorkspaces(workspaceInfoSet);


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // You are ready to start the map service
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_localMapService.start();&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After your LocalMapService has started up successfully, you are ready to add your dynamic layer to the map. It goes something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;void Sde_workspace_sample::onLocalServiceCreationSuccess(const QString&amp;amp; url, const QString&amp;amp; name)
{

&amp;nbsp;&amp;nbsp; // create the ArcGISDynamicMapServiceLayer using the LocalMapService's url
&amp;nbsp;&amp;nbsp; m_dynamicLocalServiceLayer = EsriRuntimeQt::ArcGISDynamicMapServiceLayer(m_localMapService.urlMapService());
&amp;nbsp;&amp;nbsp; m_dynamicLocalServiceLayer.setName("MySDELayer");
&amp;nbsp;&amp;nbsp; m_map.addLayer(m_dynamicLocalServiceLayer);
&amp;nbsp;&amp;nbsp; m_dynamicLocalServiceLayer.setVisible(true);


&amp;nbsp;&amp;nbsp; EsriRuntimeQt::DynamicLayerInfoCollection&amp;amp; layerInfos = m_dynamicLocalServiceLayer.dynamicLayerInfos();
&amp;nbsp;&amp;nbsp; EsriRuntimeQt::DynamicLayerInfo&amp;amp; layerInfo = layerInfos[0];

&amp;nbsp;&amp;nbsp; // Create some symbology for the added layer
&amp;nbsp;&amp;nbsp; EsriRuntimeQt::SimpleRenderer simpleRenderer(EsriRuntimeQt::SimpleFillSymbol(QColor("yellow"),EsriRuntimeQt::SimpleFillSymbolStyle::Solid, EsriRuntimeQt::SimpleLineSymbol(QColor("black"), 1, EsriRuntimeQt::SimpleLineSymbolStyle::Solid)));
&amp;nbsp;&amp;nbsp; EsriRuntimeQt::DrawingInfo countriesDrawingInfo(simpleRenderer, 20);
&amp;nbsp;&amp;nbsp; layerInfo.setDrawingInfo(countriesDrawingInfo);


&amp;nbsp;&amp;nbsp; // set dynamic workspaces for our local map service
&amp;nbsp;&amp;nbsp; EsriRuntimeQt::TableDataSource sdeDataSource;
&amp;nbsp;&amp;nbsp; sdeDataSource.setWorkspaceId(m_workspaceId);

&amp;nbsp;&amp;nbsp; // Here is where you identify the feature class you want to add
&amp;nbsp;&amp;nbsp; sdeDataSource.setDataSourceName(QString("nongdb.map.CALIFORNIA"));

&amp;nbsp;&amp;nbsp; // Set the layer's datasource
&amp;nbsp;&amp;nbsp; EsriRuntimeQt::LayerDataSource layerDataSource;
&amp;nbsp;&amp;nbsp; layerDataSource.setDataSource(sdeDataSource);
&amp;nbsp;&amp;nbsp; layerInfo.setLayerSource(layerDataSource);


&amp;nbsp;&amp;nbsp; m_dynamicLocalServiceLayer.refresh();


}&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope this is helpful! Let us know...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:34:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/connect-and-query-database/m-p/408786#M2059</guid>
      <dc:creator>EricBader</dc:creator>
      <dc:date>2021-12-11T18:34:48Z</dc:date>
    </item>
  </channel>
</rss>

