0 Replies Latest reply on Jul 14, 2007 1:10 PM by Handycam

    Displaying SQL result in data grid

    Handycam Level 1
      I'm trying to access a local DB file using an Air app. I can successfully create the connection and connect; what I'm really stuck on is displaying the data from my request in a Data Grid.

      Using this code I can see my records in the console, but how do I get it into a data grid? It doesn't seem to want to go into an ArrayColleciton.

      quote:


      function selectResult(event:SQLEvent):void
      {
      var result:SQLResult = selectStmt.getResult();
      resultData = result;
      var numRows:int = result.data.length;
      for (var i:int = 0; i < numRows; i++)
      {
      var output:String = "";
      for (var columnName:String in result.data )
      {
      output += columnName + ": " + result.data
      [columnName] + "; ";
      }
      trace("row[" + i.toString() + "]\t", output);
      }
      }