user1500403
user1500403

Reputation: 569

SQLITE Pragma to return a value in vb.net

Reading the SQLite documentation I notice that there are Pragmas that can return or set values. I would like to use Pragma table_info(tablename) and Pragma page_size. How do I execute this within a Vb.net program to obtain the list of columns and page size respectively from the two pragmas ?

Edit:

here is the code that will get the information, just thought that it might come in handy to someone

 Dim temp = New DataTable
    temp.Clear()

    Using oMainQueryR As New SQLite.SQLiteCommand
        oMainQueryR.CommandText = ("PRAGMA table_info(yourtablename)")
        Using connection As New SQLite.SQLiteConnection(conectionString)
            Using oDataSQL As New SQLite.SQLiteDataAdapter
                oMainQueryR.Connection = connection
                oDataSQL.SelectCommand = oMainQueryR
                connection.Open()
                oDataSQL.Fill(temp)
                connection.Close()
            End Using
        End Using
    End Using

the resulting datatable has columns and information in rows.

Upvotes: 1

Views: 934

Answers (1)

CL.
CL.

Reputation: 180080

Just use that pragma as you would use a SELECT x FROM y statement.

Upvotes: 1

Related Questions