Hello, I am new to the Pro SDK so may be making some rookie mistakes but when I run this. It fails to create a table view. Any help is appreciated. Thank you
private static async Task<IGPResult> MakeTableView(string adorTablePathName, string viewName)
{
try
{
// Create the parameters array for the tool
var parameters = Geoprocessing.MakeValueArray(adorTablePathName, viewName);
// Execute the tool asynchronously
IGPResult result = await Geoprocessing.ExecuteToolAsync("MakeTable_View_management", parameters);
// Check if the tool execution was successful
if (result.IsFailed)
{
Console.WriteLine("Tool execution failed.");
ShowGPErrorMessage(result, "Make Table View");
}
else
{
Console.WriteLine("Table view created successfully!");
}
return result;
}
catch (Exception ex)
{
// Log any unexpected errors during the execution
Console.WriteLine($"An error occurred: {ex.Message}");
return null;
}
}
Here is how I am calling it
IGPResult gPResult;
gPResult = await MakeTableView (adorTablePathName, "GISLicenseReport_View");
if (gPResult.IsFailed)
ShowGPErrorMessage(gPResult, "Make Table View");
Solved! Go to Solution.
Hi,
Your geoprocessing tool name is invalid. Remove extra '_'. Like "MakeTableView_management"
Aim higher
Hi,
Your geoprocessing tool name is invalid. Remove extra '_'. Like "MakeTableView_management"
Thank you @GKmieliauskas for looking over my shoulder. I was guessing it was something simple but I am a novice so I appreciate your help!