jeudi 31 mars 2016

How do know the csv created from SQLite is closed so I can read from it?

In vb.net, I have my program run sqlite3.exe. Sqlite3 runs the following commands, which are stored in a text file:

.open prod.db
.mode csv
.output output.csv
SELECT STATEMENT
.output stdout
.exit

Once output.csv has been created, I then run a Streamreader to see what the results were and I get the following error:

The process cannot access the file 'output.csv' because it is being used by another process.

However, I know it is not locked up for long because I can go to the csv and open it manually after it is created.

I would write code to check to see when the process finishes, but I'm not sure what process is running to check this (I already check for SQLite3.exe to close). In other words, how do I know my csv is free for Streamreader to open?

Aucun commentaire:

Enregistrer un commentaire