{"id":29621,"date":"2022-10-11T16:08:55","date_gmt":"2022-10-11T14:08:55","guid":{"rendered":"https:\/\/help.qualiware.it\/qw-help\/?p=29621"},"modified":"2022-10-11T16:42:25","modified_gmt":"2022-10-11T14:42:25","slug":"lettura-dati-da-database-sqlite","status":"publish","type":"post","link":"https:\/\/help.qualiware.it\/qw-help\/lettura-dati-da-database-sqlite\/","title":{"rendered":"Lettura dati da database SQLite"},"content":{"rendered":"<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">' E' possibile leggere in modo nativo i dati da un file di database SQLite\r\n' Per farlo, \u00e8 necessario copiare nella cartella \"bin\" del server i file contenuti nello zip scaricabile da qui: https:\/\/help.qualiware.it\/qw-help\/wp-content\/uploads\/sqlite.zip, \r\n' e utilizzare il seguente esempio, modificando il percorso del file, la query e i nomi dei campi\r\n\r\nDim conn As System.Data.SQLite.SQLiteConnection\r\nconn = New  System.Data.SQLite.SQLiteConnection(\"Data Source=C:\\temp\\CNcom.db;Version=3;New=True;Compress=True;\")\r\n\r\nconn.Open()\r\nDim sqlite_datareader As System.Data.SQLite.SQLiteDataReader\r\nDim sqlite_cmd As System.Data.SQLite.SQLiteCommand\r\nsqlite_cmd = conn.CreateCommand()\r\nsqlite_cmd.CommandText = \"SELECT Key,Value FROM MachineStatus\"\r\nsqlite_datareader = sqlite_cmd.ExecuteReader()\r\nWhile sqlite_datareader.Read()        \r\n    Console.WriteLine(\"Key: \"+sqlite_datareader.Item(\"Key\")+\" Value: \"+sqlite_datareader.Item(\"Value\"))\r\nEnd While\r\nconn.Close()\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>&#8216; E&#8217; possibile leggere in modo nativo i dati da un file di database SQLite &#8216; Per farlo, \u00e8 necessario copiare nella cartella &#8220;bin&#8221; del server i file contenuti nello zip scaricabile da qui: https:\/\/help.qualiware.it\/qw-help\/wp-content\/uploads\/sqlite.zip, &#8216; e utilizzare il seguente esempio, modificando il percorso del file, la query e i nomi dei campi Dim conn&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"ngg_post_thumbnail":0,"footnotes":""},"categories":[65],"tags":[71,82],"acf":[],"_links":{"self":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/posts\/29621"}],"collection":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/comments?post=29621"}],"version-history":[{"count":1,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/posts\/29621\/revisions"}],"predecessor-version":[{"id":29622,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/posts\/29621\/revisions\/29622"}],"wp:attachment":[{"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/media?parent=29621"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/categories?post=29621"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/help.qualiware.it\/qw-help\/wp-json\/wp\/v2\/tags?post=29621"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}