<?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 Trying to create ITable from a MS SQL Server Express table with spatial column in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/trying-to-create-itable-from-a-ms-sql-server/m-p/63284#M1724</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, I'm pretty new to C#, SQL Server, and AO so excuse the noobness.&amp;nbsp; What I want to do is take the AdventureWorks2012.Person.Address table (which contains the "SpatialLocation" geography column) stored in my local MS SQL Server Express server and create a query layer and eventually create an ILayer to display in a MapControl on a Windows form.&amp;nbsp; I've tried searching the forums but haven't had any luck finding anything.&amp;nbsp; Is there an example of this that someone can explain to me or point me to?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Martin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Apr 2012 23:28:19 GMT</pubDate>
    <dc:creator>MartinWong</dc:creator>
    <dc:date>2012-04-24T23:28:19Z</dc:date>
    <item>
      <title>Trying to create ITable from a MS SQL Server Express table with spatial column</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/trying-to-create-itable-from-a-ms-sql-server/m-p/63284#M1724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, I'm pretty new to C#, SQL Server, and AO so excuse the noobness.&amp;nbsp; What I want to do is take the AdventureWorks2012.Person.Address table (which contains the "SpatialLocation" geography column) stored in my local MS SQL Server Express server and create a query layer and eventually create an ILayer to display in a MapControl on a Windows form.&amp;nbsp; I've tried searching the forums but haven't had any luck finding anything.&amp;nbsp; Is there an example of this that someone can explain to me or point me to?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Martin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Apr 2012 23:28:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/trying-to-create-itable-from-a-ms-sql-server/m-p/63284#M1724</guid>
      <dc:creator>MartinWong</dc:creator>
      <dc:date>2012-04-24T23:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to create ITable from a MS SQL Server Express table with spatial column</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/trying-to-create-itable-from-a-ms-sql-server/m-p/63285#M1725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;After doing more research I finally figured it out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Esri has an exact example of what I was trying to accomplish here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//001p0000000t000000"&gt;http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//001p0000000t000000&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My problem was that I've been trying to use a SqlWorkspaceFactory instead of an OLEDBWorkspaceFactory, plus I was missing the "@" character in my connection string.&amp;nbsp; Also, Esri's SqlWorkspaceFactory example was for a connection to an Oracle DB using a PropertySet so the connection parameters were very different.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Martin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2012 17:45:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/trying-to-create-itable-from-a-ms-sql-server/m-p/63285#M1725</guid>
      <dc:creator>MartinWong</dc:creator>
      <dc:date>2012-04-25T17:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to create ITable from a MS SQL Server Express table with spatial column</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/trying-to-create-itable-from-a-ms-sql-server/m-p/63286#M1726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I guess I spoke too soon.&amp;nbsp; Apparently the OLEDBWorkspaceFactory cannot be used to connect to spatial data.&amp;nbsp; But, I was finally able to use the SqlWorkspaceFactory once I got the connection parameters right:&lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;dbclient = "SQLServer"&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;serverinstance = "MyPCName"&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;authentication_mode = "OSA"&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;database = "AdventureWorks2012"&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;SPAN&gt;After connecting and getting the SQLworkspace, I setup my queryDescription to the Person.Address table and used the OpenQueryClass method to create my feature class to add to the map control.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Martin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Apr 2012 19:43:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/trying-to-create-itable-from-a-ms-sql-server/m-p/63286#M1726</guid>
      <dc:creator>MartinWong</dc:creator>
      <dc:date>2012-04-26T19:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to create ITable from a MS SQL Server Express table with spatial column</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/trying-to-create-itable-from-a-ms-sql-server/m-p/63287#M1727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Martin,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this SDE database?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;David&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 May 2012 09:13:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/trying-to-create-itable-from-a-ms-sql-server/m-p/63287#M1727</guid>
      <dc:creator>DavidLednik</dc:creator>
      <dc:date>2012-05-01T09:13:20Z</dc:date>
    </item>
  </channel>
</rss>

