2012-09-22 43 views
1

讀取SQLite文檔我注意到有些Pragma可以返回或設置值。我想使用Pragma table_info(tablename)和Pragma page_size。如何在Vb.net程序中執行此操作以分別從兩個編譯指示中獲取列和頁面大小的列表?SQLITE Pragma在vb.net中返回一個值

編輯:

這裏是代碼,將獲得的信息,只是認爲它可能會派上用場的人

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 

生成的表具有行和列的信息。

回答

1

只需使用該編譯指示,就像使用SELECT x FROM y語句一樣。