This is a migrated thread and some comments may be shown as answers.

SQLite not working with IOS(iPhone/iPad)

3 Answers 39 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Tim
Top achievements
Rank 1
Tim asked on 25 Mar 2014, 05:32 PM
As summed by the title, my project with a sqlite db works perfectly with the Android and on the simulator. Data is successfully being spanned onto a table, however when it comes to the iphone, it does create the header but no data is selected at all for the table body. Code showed as below.
 
I did some research an people said it's mainly due to syntax error when executing the database, but I hardly find any typos? Appreciate any pointers!

app.refresh = function(){ 
    
    var render = function (tx, rs){
        //GENERATE TABLE WITH HEADER
        var table = "<table id='page1table'><thead><th>AssetID</th></tr></thead><tbody>";

        //THIS IS THE PART NOT WORKING, AND rs.rows.length IS ALWAYS ZERO
        for (var i = 0; i < rs.rows.length; i++) {  
            var row = rs.rows.item(i);
            table += "<tr><td>" + row.AssetID + "</td></tr>"; 
        }        
        table += "</tbody></table>";
        
        var todoItems = document.getElementById("content");
        todoItems.innerHTML = table;   

    }
    
//Open DB
var db = app.db;
db.transaction(function(tx) {
tx.executeSql("SELECT AssetID FROM tblApp", [],
 render, 
 app.onError);
}); 
}

3 Answers, 1 is accepted

Sort by
0
Tim
Top achievements
Rank 1
answered on 26 Mar 2014, 03:24 PM
I've done some testing myself, it's quite certain that everything is working all fine, as of running on Android. So now the problem is pinned down to compatibility with IOS, I wonder has anyone came across this problem before? I've been searching the internet but there're ample of sqlite3 example but not sqlite... Great if anyone can share some thought. Thank you.
0
Tim
Top achievements
Rank 1
answered on 26 Mar 2014, 03:47 PM
HERE attached is a complete code for my test. GitHub Clone URL: https://github.com/faat99/table-to-json.git

Please suggest if any abnormality causing the error? Note that all the alert warnings I implemented into the codes fire as expected so that implies the SQLite statement is executed but not extracting anything. 

0
Zdravko
Telerik team
answered on 28 Mar 2014, 10:15 AM
Hi Tim,

Would you please provide us your project name or the project itself in a private ticket so we could take a look at it?
Thanks.

Regards,
Zdravko
Telerik
 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET. Seats are limited.

 
Tags
General Discussion
Asked by
Tim
Top achievements
Rank 1
Answers by
Tim
Top achievements
Rank 1
Zdravko
Telerik team
Share this question
or