<?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 ArcGIS Pro SDK C#:  Copy features from SDE to Project Geodatabase in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-c-copy-features-from-sde-to-project/m-p/1138009#M7701</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to copy a feature class from an SDE geodatabase into my project's default database but it's not working.&amp;nbsp; Following is my code in C#:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;private async void BtnRun_Click(object sender, RoutedEventArgs e)
{
    sdePath = TboxPath.Text;
    in_features = TboxInFeature.Text;
    string url = System.IO.Path.Combine(sdePath, in_features);
    Uri uri = new Uri(url);
    string infc = Path.Combine(sdePath, in_features);
    string outfc = Path.Combine(Project.Current.DefaultGeodatabasePath, lyrName);

    await QueuedTask.Run(() =&amp;gt;
    {
	Geoprocessing.ExecuteToolAsync("CopyFeatures_management", Geoprocessing.MakeValueArray(infc, outfc));
    });
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then after I copy it to the default geodatabase, I want to load it as a layer on my active map.&lt;/P&gt;&lt;P&gt;Appreciate any help.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jan 2022 18:57:59 GMT</pubDate>
    <dc:creator>JadedEarth</dc:creator>
    <dc:date>2022-01-27T18:57:59Z</dc:date>
    <item>
      <title>ArcGIS Pro SDK C#:  Copy features from SDE to Project Geodatabase</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-c-copy-features-from-sde-to-project/m-p/1138009#M7701</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to copy a feature class from an SDE geodatabase into my project's default database but it's not working.&amp;nbsp; Following is my code in C#:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;private async void BtnRun_Click(object sender, RoutedEventArgs e)
{
    sdePath = TboxPath.Text;
    in_features = TboxInFeature.Text;
    string url = System.IO.Path.Combine(sdePath, in_features);
    Uri uri = new Uri(url);
    string infc = Path.Combine(sdePath, in_features);
    string outfc = Path.Combine(Project.Current.DefaultGeodatabasePath, lyrName);

    await QueuedTask.Run(() =&amp;gt;
    {
	Geoprocessing.ExecuteToolAsync("CopyFeatures_management", Geoprocessing.MakeValueArray(infc, outfc));
    });
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then after I copy it to the default geodatabase, I want to load it as a layer on my active map.&lt;/P&gt;&lt;P&gt;Appreciate any help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 18:57:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-c-copy-features-from-sde-to-project/m-p/1138009#M7701</guid>
      <dc:creator>JadedEarth</dc:creator>
      <dc:date>2022-01-27T18:57:59Z</dc:date>
    </item>
    <item>
      <title>Re: ArcGIS Pro SDK C#:  Copy features from SDE to Project Geodatabase</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-c-copy-features-from-sde-to-project/m-p/1138640#M7712</link>
      <description>&lt;P&gt;Found the solution.&amp;nbsp; Instead of CopyFeatures_management tool, I used FeatureClassToFeatureClass_conversion tool since I'm dealing with two geodatabases.&lt;/P&gt;&lt;P&gt;Below is the solution.&amp;nbsp; This copies the feature class to the default project geodatabase from a SQL Server geodatabase and displays it on the active map after copying:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt; private async void BtnRun_Click(object sender, RoutedEventArgs e)
{
    string infc = TboxInFeatures.Text;               
    string outputLocation = Project.Current.DefaultGeodatabasePath;
    string outputName = TboxFcName.Text;

    ProgressDialog progDlg = new ProgressDialog("feature Class to Feature Class...", "Cancel", 100, true);
    progDlg.Show();

    IReadOnlyCollection&amp;lt;string&amp;gt; args = Geoprocessing.MakeValueArray(infc, outputLocation, outputName);
    IGPResult gp_result = await Geoprocessing.ExecuteToolAsync("FeatureClassToFeatureClass_conversion", args, null,
                new CancelableProgressorSource(progDlg).Progressor, GPExecuteToolFlags.Default);
}&lt;/LI-CODE&gt;&lt;P&gt;.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jan 2022 12:04:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/arcgis-pro-sdk-c-copy-features-from-sde-to-project/m-p/1138640#M7712</guid>
      <dc:creator>JadedEarth</dc:creator>
      <dc:date>2022-01-29T12:04:28Z</dc:date>
    </item>
  </channel>
</rss>

