Should the following statement be autocomposite ? I get an IOException trying to delete a file after executing the request.
using (SQLiteConnection connection = new SQLiteConnection("Data Source=" + AppDomain.CurrentDomain.BaseDirectory + "data\\test.db;Version=3;")) { connection.Open(); SQLiteCommand command = new SQLiteCommand("CREATE TABLE IF NOT EXISTS test (id INTEGER)", connection); command.ExecuteNonQuery(); } //throwing an IOException File.Delete(AppDomain.CurrentDomain.BaseDirectory + "data\\test.db");
I'm late to the party, but I had to:
GC.WaitForPendingFinalizers(); GC.Collect();
Before calling File.Delete ().
Is SQLiteCommand Dispose (capable)? The connection may not close because you have not closed the command. I would also use this to use.
, : # # sqlite - , , , , ?
Of course, if this is not so much data, you should just use the database in memory. Why bother file system data if you don't need it? You need this connection string:
Data Source=file::memory:;Version=3;
Did you try to close the connection after executing the request?
connection.Close();
Source: https://habr.com/ru/post/1744300/More articles:C #: do enumerations as strings or integers depending on context - enumsJSF question about the relationship between managed beans - faceletsInternationalized strings in Eclipse plugin.xml not found during installation in Eclipse - javaHow to create a GIF file from another format file in C ++ - c ++How to create a 2-bit gif from a tiff file in dotnet - .nethttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1744301/get-and-parse-json-with-jquery-from-gmaps-to-find-coordinates&usg=ALkJrhhI8DDwyEAq_7WiEAcrSY0lAPb3zQJAR file: digital signature - jarXSLT for each element collection loop - loopsGetting document.xml from a docx file using ZipInputStream - javaAlgorithm for a problem with cubes - algorithmAll Articles