sqqlite to ListView

I am trying to populate a list view from a sqllite database but I don´t know what to do:

This is what I am doing:

require "sqlite3"  
local path = system.pathForFile("Mydb", system.ResourceDirectory)  
db = sqlite3.open( path )   
local sql = "SELECT \* FROM tblnames"  
for row in db:nrows(sql) do  
 data={}  
 data.namn=row.namn  

This is where I don´t get it, it should be something like:

for i=1,#row do
data[i]={}
data[i].namn=row.namn

  
end  
myList = tableView.newList{  
 data=data,  
 default="Listbg".png",  
 over="Listbgdown.png",  
 onRelease=listButtonRelease,  
 top=60,  
 bottom=60,  
 callback=function(row)  
 local t = display.newText(row.namn, 0, 0, native.systemFont, 24)  
 t:setTextColor(255,165,0)  
 t.x =20  
 t.y = 25  
 return t  
 end  
}  
  

Maholm [import]uid: 5717 topic_id: 21597 reply_id: 321597[/import]

I got it:

i=0  
for row in db:nrows(sql) do  
  
i=i+1  
 data[i]={}  
 data[i].namn=row.namn  
table.insert(data[i],row)  
end  

Maholm [import]uid: 5717 topic_id: 21597 reply_id: 85646[/import]