System.ArgumentException with Blob data

Dec 19, 2014 at 9:52 AM
I'am developing a App with blob sqlile DB. But my insert statement error:

System.ArgumentException: Value does not fall within the expected range.

error with PrepareStatementAsync method.

My code:
String command = "INSERT INTO Fleet (fleetId,enterpriseId,code,data,searchText) VALUES(?, ?, ?, ?, ?)";
 using (var insertStatement = await database.PrepareStatementAsync(command))
                {
                    foreach (Fleet item in list)
                    {
                        item.data = SQLiteUtil.encode(convertDataToBytes(item));

                        insertStatement.BindIntParameterAt(1, item.fleetId);
                        insertStatement.BindIntParameterAt(2, item.enterpriseId);
                        insertStatement.BindTextParameterAt(3, item.code);
                        insertStatement.BindBlobParameterAt(4, item.data.AsBuffer());
                        insertStatement.BindTextParameterAt(5, item.searchText);
                        await insertStatement.StepAsync();
                    }
                }
Dec 22, 2014 at 1:50 AM
Edited Dec 22, 2014 at 9:36 AM
I have fixed it.

The cause of bug is my thread control in WP.
Jan 22, 2015 at 2:50 PM
Can you explain the solution please ? I have the same problem.