<?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 still confused please help. Connect to SDE and get access to table in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/still-confused-please-help-connect-to-sde-and-get/m-p/16706#M372</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, I'm having trouble getting access to the tables in a SQL SDE database using c# .Net. Could anyone please post an example of a connection and then getting accessing a table. My main goal is to take a table from the database (which is a centerline shapefile I loaded) and change its projection. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;And take a different table and make it a dataset using IDataset or the geodatabse equivalent.Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Mar 2012 14:50:20 GMT</pubDate>
    <dc:creator>jamesborris</dc:creator>
    <dc:date>2012-03-16T14:50:20Z</dc:date>
    <item>
      <title>still confused please help. Connect to SDE and get access to table</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/still-confused-please-help-connect-to-sde-and-get/m-p/16706#M372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, I'm having trouble getting access to the tables in a SQL SDE database using c# .Net. Could anyone please post an example of a connection and then getting accessing a table. My main goal is to take a table from the database (which is a centerline shapefile I loaded) and change its projection. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;And take a different table and make it a dataset using IDataset or the geodatabse equivalent.Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 14:50:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/still-confused-please-help-connect-to-sde-and-get/m-p/16706#M372</guid>
      <dc:creator>jamesborris</dc:creator>
      <dc:date>2012-03-16T14:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: still confused please help. Connect to SDE and get access to table</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/still-confused-please-help-connect-to-sde-and-get/m-p/16707#M373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi, I'm having trouble getting access to the tables in a SQL SDE database using c# .Net. Could anyone please post an example of a connection and then getting accessing a table. My main goal is to take a table from the database (which is a centerline shapefile I loaded) and change its projection. &lt;BR /&gt;And take a different table and make it a dataset using IDataset or the geodatabse equivalent.Thanks.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Get a table:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;public ITable GetTable( string query, string keyFieldName ) {&amp;nbsp; IWorkspaceFactory2 workspaceFactory2;&amp;nbsp; IWorkspace workspace;&amp;nbsp; ISqlWorkspace sqlWorkspace;&amp;nbsp; ITable table;&amp;nbsp; using ( ComReleaser comReleaser = new ComReleaser() )&amp;nbsp; { &amp;nbsp; // create types &amp;nbsp; Type factoryType = Type.GetTypeFromProgID( "esriDataSourcesGDB.SqlWorkspaceFactory" ); &amp;nbsp; workspaceFactory2 = Activator.CreateInstance( factoryType ) as IWorkspaceFactory2; &amp;nbsp; workspace = workspaceFactory2.OpenFromString( this.connection, 0 ); &amp;nbsp; sqlWorkspace = workspace as ISqlWorkspace; &amp;nbsp; // manage releasable objects &amp;nbsp; comReleaser.ManageLifetime( workspaceFactory2 ); &amp;nbsp; comReleaser.ManageLifetime( sqlWorkspace ); &amp;nbsp; // prepare query &amp;nbsp; IQueryDescription queryDescription = sqlWorkspace.GetQueryDescription( query ); &amp;nbsp; queryDescription.OIDFields = keyFieldName; &amp;nbsp; // get a unique name &amp;nbsp; string datasetName = "S"; &amp;nbsp; sqlWorkspace.CheckDatasetName( "S", queryDescription, out datasetName ); &amp;nbsp; // execute&amp;nbsp; &amp;nbsp; table = sqlWorkspace.OpenQueryClass( datasetName, queryDescription );&amp;nbsp; }&amp;nbsp; return table; }&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Mar 2012 17:30:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/still-confused-please-help-connect-to-sde-and-get/m-p/16707#M373</guid>
      <dc:creator>GeorgeFaraj</dc:creator>
      <dc:date>2012-03-16T17:30:08Z</dc:date>
    </item>
  </channel>
</rss>

