0

I can easily get the table names from a System.Data.SQLiteConnection like this:

 Public Function GetTableNames(ByVal uCn As SQLite.SQLiteConnection, ByVal uDBName As String) As List(Of String)

    Dim nTables As New List(Of String)
    Dim dt As DataTable = uCn.GetSchema("tables")
    For Each nRow As DataRow In dt.Rows
        Dim sTableName As String = nRow(2)
        nTables.Add(sTableName)
    Next

    Return nTables

End Function

However, I don't see how I can determine which database exactely I want to use. With the current approach, the table names are taken from the main database.

Does anybody know how I can say that want to get the table names from a specific database attached to the connection?

1 Answer 1

2

GetSchema does not support attached databases. You have read the table names directly from the system table:

SELECT name FROM MyOtherDB.sqlite_master WHERE type = 'table'
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.