classProgram {Static voidMain (string[] args) {Getsqlitedata (); } Public Static voidGetsqlitedata () {sqliteconnection CNN=Newsqliteconnection (); Cnn. ConnectionString=@"Data source=d:\test.db"; Cnn. Open (); stringsql ="select * FROM table"; Sqlitecommand cmd=CNN. CreateCommand (); Cmd.commandtext=SQL; Sqlitedatareader Reader=cmd. ExecuteReader (); List<ImportInfo> infolist =NewList<importinfo>(); while(reader. Read ()) {Importinfo Info=NewImportinfo (); varTempStr = reader. GetString (4); DynamicJsoninfos =Jsonconvert.deserializeobject (TEMPSTR); varEpisode_title =Jsoninfos.episode_title. ToString (); varAudio_file_name =Jsoninfos.audio_file_name. ToString (); varLrc_file_name =Jsoninfos.lrc_file_name. ToString (); Infolist.add (NewImportinfo () {data1 = data1, data2 = data2}); } } } Public classImportinfo { Public stringdata1{Get;Set; } Public stringdata2{Get;Set; } }
C # reading SQLite files