### Get List of TableColumns

An example of a Sub to get the list of TableColumns.
`Public Sub DBGetTableColumns(Tablename As String) As List
Log("DBGetTableColumns :: Start = " & Tablename)
Dim Result As List
Result.Initialize
Dim cursor As ResultSet
Dim cmd As String = "PRAGMA table_info(" & Tablename & ");"
Try
cursor = gSQL.ExecQuery (cmd)
Do While cursor.NextRow
Result.Add(cursor.GetString("name"))
Loop
Catch
Log("Error", "Get List of TableColumns " & Tablename & " = " & LastException)
End Try
Log("DBGetTableColumns :: End = Columncount:" & Result.size)
Return Result
End Sub`
Usage example
Private DBTableContacts As String = "contacts"
Log("List of TableColumns")
Dim l As List = DBGetTableColumns(DBTableContacts)
For i = 0 To l.Size - 1
Log(l.Get(i))
Next
Output:
ID
Name
EMail

Changed: , Category: SQLite, File: T6C254M1824.htm, ID: 1824