Reputation: 569
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