Ciao.
Debbo aprire un file .sqlite, vedere cosa c'è, ed estrarre i dati.
Ho vs2010 e vs2017.
Qualcuno ha qualche consiglio da darmi su cosa installare e come procedire?![]()
Ciao.
Debbo aprire un file .sqlite, vedere cosa c'è, ed estrarre i dati.
Ho vs2010 e vs2017.
Qualcuno ha qualche consiglio da darmi su cosa installare e come procedire?![]()
Pietro
grazie della risposta super veloce!
Allora, quel sito lo conosco bene ma non mi basta.
Presumo che debba installare qualche driver nel computer. Ma quale? a 32 o 64 bit? ODBC o .NET?
E se voglio vedere prima cosa c'è nel database, con visual studio?
Insomma, non so da che parte rigirarmi![]()
Pietro
nella pagina sono elencate anche le librerie che servono
poi facce sape'![]()
La libreria su nuGet:
https://www.nuget.org/packages/System.Data.SQLite
La documentazione:
http://system.data.sqlite.org/index....www/index.wiki
Un esempio da stack overflow:
codice:using System; using System.Text; using System.Data; using System.Data.SQLite; namespace MySqlLite { class DataClass { private SQLiteConnection sqlite; public DataClass() { //This part killed me in the beginning. I was specifying "DataSource" //instead of "Data Source" sqlite = new SQLiteConnection("Data Source=/path/to/file.db"); } public DataTable selectQuery(string query) { SQLiteDataAdapter ad; DataTable dt = new DataTable(); try { SQLiteCommand cmd; sqlite.Open(); //Initiate connection to the db cmd = sqlite.CreateCommand(); cmd.CommandText = query; //set the passed query ad = new SQLiteDataAdapter(cmd); ad.Fill(dt); //fill the datasource } catch(SQLiteException ex) { //Add your exception code here. } sqlite.Close(); return dt; } }
Ultima modifica di djciko; 03-02-2020 a 11:59
press play on tape
-----
MP3 Listing
https://sourceforge.net/projects/mp3-listing
File Listing
https://sourceforge.net/projects/file-listing-2-0/
In effetti pensavo fosse più semplice.
Con vs2017 ho installato SqlCeVsToolbox.4.7.666.vsix, che mi permette di osservare con vs cosa c'è nel file.
Sempre con vs2017 ho provato a leggere una tabella usando la libreria consigliata https://www.nuget.org/packages/System.Data.SQLite
Con vs 2010 la musica cambia, perchè non riesco a installare il package. Ho risolto installando le due librerie SQLite.Interop.dll e System.Data.SQLite.dll
![]()
Pietro
press play on tape
-----
MP3 Listing
https://sourceforge.net/projects/mp3-listing
File Listing
https://sourceforge.net/projects/file-listing-2-0/