ThinkGeo.com    |     Documentation    |     Premium Support

GetAllFeatures exception for SqliteFeatureLayer

Hi,

I’m trying to get all features from SqliteFeatureLayer using the following which worked in v9.

SqliteFeatureLayer sql = layer as SqliteFeatureLayer;
sql.Open();
Collection theseFeatures = sql.FeatureSource.GetAllFeatures(ReturningColumnsType.AllColumns);
sql.Close();

Here’s the error.

System.Data.SQLite.SQLiteException
HResult=0x800007BF
Message=SQL logic error
near “AND”: syntax error
Source=System.Data.SQLite
StackTrace:
at System.Data.SQLite.SQLite3.Prepare(SQLiteConnection cnn, String strSql, SQLiteStatement previous, UInt32 timeoutMS, String& strRemain)
at System.Data.SQLite.SQLiteCommand.BuildNextCommand()
at System.Data.SQLite.SQLiteDataReader.NextResult()
at System.Data.SQLite.SQLiteDataReader…ctor(SQLiteCommand cmd, CommandBehavior behave)
at System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior)
at ThinkGeo.MapSuite.Layers.SqliteFeatureSource.GetAllFeaturesCore(IEnumerable1 columnNames) at ThinkGeo.MapSuite.Layers.FeatureSource.GetAllFeatures(IEnumerable1 returningColumnNames)

Thanks,
Damian

Thanks Damian,
I tested with the Sqlite file. it works fine.Could you try your data with the demo project? If not work can you sent us the sqlite file. We could look into more detail.

Thanks

Frank

Hi Frank,

It definitely doesn’t work in v10.5. This goes for all of the inherent functions like GetFeaturesById and GetFeaturesByColumnName. Maybe in current release it is fixed.

However, I just wrote my own matching queries using System.Data.SQLite and I’m back up and running. I was also able to optimize my queries to work a bit faster by taking advantage of my data structure for additional filtering so I won’t need to pursue this issue further. I would encourage others to explore this route as well.

Regards,
Damian