Hello,
Based on this example L. 90, I'm trying to create a FeatureClass in an Oracle database using the geoprocessing tool "managment.CreateTable".
In the documentation it's said that the argument "out_path" should be of type Workspace.
Problem is, in this documentation, it is said that only the following classes are supported :
- Scalars – long, short, float, double, date, string
- ArcGIS.Core.Geometry.SpatialReference
- ArcGIS.Core.Geometry – point, line, polygon
- ArcGIS.Core.Geometry.Envelope – supporting GP types of GPExtentEnv, GPExtent, GPEneveope
- ArcGIS.Core.Data.Field – supporting GPField and list of fields for GPFieldList
- ArcGIS.Desktop.Mapping – Layer, StandaloneTable
- ArcGIS.Core.Data.Dataset – Table, FeatureClass
Based on those informations I'm using the following code
private static Task<IGPResult> CreateFeatureClass(Geodatabase geodatabase,
string tableName,
Table templateTable)
{
var args = Geoprocessing.MakeValueArray(
geodatabase.GetConnectionString(),
GetTempoLayerNameFromFClassName(tableName),
templateTable,
null
);
System.Threading.CancellationTokenSource _cts = new System.Threading.CancellationTokenSource();
return Geoprocessing.ExecuteToolAsync("managment.CreateTable", args, null, _cts.Token,
(event_name, o) => // implement delegate and handle events, o is message object.
{
switch (event_name)
{
case "OnValidate": // stop execute if any warnings
if ((o as IGPMessage[]).Any(it => it.Type == GPMessageType.Warning))
_cts.Cancel();
break;
case "OnProgressMessage":
string msg = string.Format("{0}: {1}", new object[] { event_name, (string)o });
System.Diagnostics.Debug.WriteLine(msg);
_cts.Cancel();
break;
case "OnProgressPos":
string msg2 = string.Format("{0}: {1} %", new object[] { event_name, (int)o });
System.Diagnostics.Debug.WriteLine(msg2);
_cts.Cancel();
break;
}
});
}
The results of the request is :
ErrorCode = 2147483647
HasWarnings = False
IsFailed = True
IsCanceled = False
There is no messages whatsoever.
I have no idea how to debug that part.
Do you have any clue ?
Best regards,
Marcus