mercredi 25 novembre 2015

SQLite3.Step (stmt) returns Error in Windows Runtime Apps

I'm executing a SELECT query to retrieve data from SQLite database, but it doesn't return the required data. I don't know what error it is. I debugged and found that in SQLite.cs library, SQLite3.Step(stmt) is returning Error in this while statement while(SQLite3.Step(stmt) == SQLite3.Result.Row) instead of returning Row.

enter image description here

My query is: SELECT FD.*, FT.CustomScriptBeforeLoad'TemplateScriptBeforeLoad', FT.CustomScriptAfterLoad'TemplateScriptAfterLoad', RT.Description AS RecordTypeDescription FROM FieldDefinitions FD INNER JOIN RecordTypes RT ON FD.RecordTypeId = RT.RecordTypeId JOIN FormTemplates FT ON FT.FormTemplateId = RT.FormTemplateId WHERE FT.FormTemplateId = 1871 AND (IFNULL(FD.IsHidden, '') != 'true' COLLATE NOCASE AND IFNULL(FD.CanView, '') != 'false' COLLATE NOCASE ) ORDER BY FD.SortOrder ASC

I tried to execute the same query on my sqlite browser to see if the query is ok or not. But the query seems to be ok as it returns all values of 353 rows as shown in screenshot below.

enter image description here

Update 1:

I thought that the large number of rows might return Error in SQLite3.Step(stmt) so I decided to execute the same query which have AND condition.

SELECT FD.*, FT.CustomScriptBeforeLoad'TemplateScriptBeforeLoad', FT.CustomScriptAfterLoad'TemplateScriptAfterLoad', RT.Description AS RecordTypeDescription FROM FieldDefinitions FD INNER JOIN RecordTypes RT ON FD.RecordTypeId = RT.RecordTypeId JOIN FormTemplates FT ON FT.FormTemplateId = RT.FormTemplateId WHERE FT.FormTemplateId = 1871 AND (IFNULL(FD.IsHidden, '') != 'true' COLLATE NOCASE AND IFNULL(FD.CanView, '') != 'false' COLLATE NOCASE ) AND FieldDefinitionId >31000 ORDER BY FD.SortOrder ASC

And this query returns the 100 rows. In my code this query executes very well as expected and returns the required values without giving Error in SQLite3.Step(stmt).

enter image description here

Please suggest me what's the solution for this. Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire