Switch display between two SQLite tables

Mahares

Expert
Licensed User
Longtime User
I have a database with two tables: one with 91 column names and the other with 54. Both have several records. I would like to have a menu or list option to select either table to display its data in a grid like spreadsheet format. Most of the examples I have seen in the forum treat a database with only one table. Klaus’s SQLite Viewer sample allows you to select a table of your choice but, you cannot filter, or sort. The header (column names) scrolls off the screen when you are scrolling vertically. Therefore, you cannot tell what data belong to what column name. SQLExample sample does almost what I want, but its database has only one table. I can write two separate projects with two separate icons, each displaying one table, but that is not efficient. I would like to be able to display the data of either table from the same application. Does any database guru have any idea on how to achieve my goal.
Thank you in advance for your assistance.
 

Brad

Active Member
Licensed User
Longtime User
Have two panels, one for each database. Just toggle the visibility property when switching between them.
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
My code is modeled after Klaus' SQLexample. It is quite complicated even for one table. It already has 3 scrollview views with their built in panels, a few additional panels, a seekbar that allows me to scroll horizontally and on top of that it has 3 layouts, one for filtering the data, one for displaying the table in a spreadsheet format and one for showing the data as one record per screen. This is all just to manage one table. Could you elaborate on how you use two additional panels you suggested. Both tables use the same code, but have different column names and number of columns. Currently, what I do is run the program for one table and if I want to see data in the other table, I go to the code and comment the column names for the other table. This is very inefficient.
Thank you
 
Upvote 0
Top