G gobblegob Member Licensed User Longtime User Jun 16, 2011 #1 Good day everyone. I am wanting to add all items in a SQLite DB to a ListView. I can get one result only with this code... Code: Copy ListView1.AddSingleLine(SQL1.ExecQuerySingleResult("SELECT col1 FROM table1")) but i cannot workout how to show every item in the DB col1 in a ListView. :BangHead: can anyone please help me i have spent almost 7 hours and have almost no code embarrassed Waz.
Good day everyone. I am wanting to add all items in a SQLite DB to a ListView. I can get one result only with this code... Code: Copy ListView1.AddSingleLine(SQL1.ExecQuerySingleResult("SELECT col1 FROM table1")) but i cannot workout how to show every item in the DB col1 in a ListView. :BangHead: can anyone please help me i have spent almost 7 hours and have almost no code embarrassed Waz.
Erel B4X founder Staff member Licensed User Longtime User Jun 16, 2011 #2 Try Basic4android Search: DBUtils It has a method named ExecuteListView which adds items to a ListView. Upvote 0
Try Basic4android Search: DBUtils It has a method named ExecuteListView which adds items to a ListView.
M Merlot2309 Active Member Licensed User Longtime User Jun 16, 2011 #3 Hello, Did you search in the examples? There are some and this should do the job without using DBUtils: Dim a Cursor and Code: Copy crNames = SQL1.ExecQuery("SELECT Name FROM Table ORDER BY Naam ASC") End If For i = 0 To crNames.RowCount - 1 crNames.Position = i Listview.AddSingleLine(crNames.GetString("Name")) Next Succes, Helen. Upvote 0
Hello, Did you search in the examples? There are some and this should do the job without using DBUtils: Dim a Cursor and Code: Copy crNames = SQL1.ExecQuery("SELECT Name FROM Table ORDER BY Naam ASC") End If For i = 0 To crNames.RowCount - 1 crNames.Position = i Listview.AddSingleLine(crNames.GetString("Name")) Next Succes, Helen.
G gobblegob Member Licensed User Longtime User Jun 16, 2011 #4 Thanks guys, I did try DBUtils but i couldnt get it to work. Thanks Helen that worked perfectly. I did read through all tutorials but the problem with a lot of tutorials in B4A i find are a bit complex for a beginner or maybe it is just me. Thankyou very much for your help :sign0188: Waz. Upvote 0
Thanks guys, I did try DBUtils but i couldnt get it to work. Thanks Helen that worked perfectly. I did read through all tutorials but the problem with a lot of tutorials in B4A i find are a bit complex for a beginner or maybe it is just me. Thankyou very much for your help :sign0188: Waz.