I’ve been reading and writing to File GeoDatabases for some time now, but I have just found that at some point in time I am now unable to create tables in these databases. I am using library 7.0.0.162 with unmanaged dependencies version 7.0.0.91
The following code snipet should do the job:
List<
string
> columns = new List<
string
>();
// Add columns
columns.Add(“NAME”);
columns.Add(“ID”);
FileGeoDatabaseFeatureLayer.CreateTable(db, “MY_TABLE”, WellKnownType.Point, columns);
However, I get the following error:
Object of type ‘System.Collections.Generic.List`1[System.String]’ cannot be converted to type ‘System.Collections.Generic.IEnumerable`1[ThinkGeo.MapSuite.Core.FeatureSourceColumn]’.
The relevant part of the stack trace is:
at System.RuntimeType.TryChangeType(Object value, Binder binder, CultureInfo culture, Boolean needsSpecialCast)
at System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo culture, BindingFlags invokeAttr)
at System.Reflection.MethodBase.CheckArguments(Object[] parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig)
at System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at ThinkGeo.MapSuite.Core.FileGeoDatabaseFeatureSource.CreateTable(String fileGeoDatabasePathName, String tableName, WellKnownType wellKnownType, IEnumerable`1 columns)
at ThinkGeo.MapSuite.Core.FileGeoDatabaseFeatureLayer.CreateTable(String fileGeoDatabasePathName, String tableName, WellKnownType wellKnownType, IEnumerable`1 columns)
Regards,
Damian