Hello,
I am using MapXtreme 9.0. I am selecting out of a layer (name is "MuniGrids") that has 6 columns (excluding Obj and MI_Style):
- Grid, COL2, COL3, COL4, COL5, & COL6
I am defining my QueryDefinition to only select out COL1 (see code line below)
- si.QueryDefinition.SetColumns("Obj,Grid,MI_Style".Split(","))
The reason is because the layer I want to insert this feature collection into, named "ResultGrids", only has one column (excluding Obj and MI_Style).
- GridName
I run this code line successfully to build the iResultSetFeatureCollection
GridFtrs = MapInfo.Engine.Session.Current.Catalog.Search("MuniGrids", si)
No matter what I do, when I run this code line (below) to insert my GridFtrs MapXtreme throws an error:
MapInfo.Engine.Session.Current.Catalog.InsertFeatures("ResultGrids")
The error thrown is:
{"Unable to parse statement : insert into ""ResultGrids""(Grid) values(@0): "}
{"Unable to parse statement : insert into ""ResultGrids""(Obj, Grid, MI_Style) values(@0, @1, @2): "}
I get this same error message whether I change my query definition to just be the column I want, or if I try to make it purposefully selection out the "MI_Style" and "obj" fields (which are normally just hidden behind the scenes)
Can anyone help out with what I am doing wrong? I feel this is going to end up being an easy fix, but I just can't figure it out.
Thanks in advance for any possible help
------------------------------
Nicholas Evanish
Senior Programmer Analyst
------------------------------