SQLite not working with IOS(iPhone/iPad)

4 posts, 0 answers
  1. Tim
    Tim avatar
    57 posts
    Member since:
    Oct 2013

    Posted 25 Mar 2014 Link to this post

    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);
    }); 
    }

  2. Tim
    Tim avatar
    57 posts
    Member since:
    Oct 2013

    Posted 26 Mar 2014 in reply to Tim Link to this post

    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.
  3. Tim
    Tim avatar
    57 posts
    Member since:
    Oct 2013

    Posted 26 Mar 2014 in reply to Tim Link to this post

    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. 

  4. Zdravko
    Admin
    Zdravko avatar
    657 posts

    Posted 28 Mar 2014 Link to this post

    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.

     
Back to Top