This question is locked. New answers and comments are not allowed.
Hi,
I have the following code:
In which I delete and insert some rows in a SQLite database and after that send this same database to an FTP server, along with some data from other sources. The problem that I'm facing here is that the SQLite database file stays locked even after the end of the first using scope, preventing me from accessing it and thus sending it to the FTP server.
My question is: is there anything that I could do to unlock this file or even change my approach and access it direct from the FTP server instead of accessing it locally and them sending it there?
Thanks in advance!
I have the following code:
...
using
(var lDbContext =
new
EntitiesModelTW2ArenaPos(SqlUtil.CommandTimeout))
{
lDbContext.ExecuteNonQuery(lScriptBancoPos, CommandType.Text);
lDbContext.SaveChanges();
}
List<ProdutoEvento> lEventoProdutos = EventoBLL.Instancia.ObterProdutosEvento(aEventoID);
using
(System.Net.WebClient lClient =
new
System.Net.WebClient())
{
lClient.Credentials =
new
System.Net.NetworkCredential(lUserName, lPassword);
lClient.UploadFile(
string
.Format(
"{0}/{1}.DB"
, lRequestUriString,
"EVENTOS"
),
"STOR"
, lCaminhoArquivoSqlite);
foreach
(ProdutoEvento lEventoProduto
in
lEventoProdutos)
{
lClient.UploadData(
string
.Format(
"{0}/{1}.PNG"
, lRequestUriString, lEventoProduto.ProdutoNome.Replace(
" "
,
string
.Empty).Substring(0, lEventoProduto.ProdutoNome.Length > iTamanhoMaximoNomeImagem ? iTamanhoMaximoNomeImagem : lEventoProduto.ProdutoNome.Length)),
"STOR"
, lEventoProduto.Imagem);
}
}
...
In which I delete and insert some rows in a SQLite database and after that send this same database to an FTP server, along with some data from other sources. The problem that I'm facing here is that the SQLite database file stays locked even after the end of the first using scope, preventing me from accessing it and thus sending it to the FTP server.
My question is: is there anything that I could do to unlock this file or even change my approach and access it direct from the FTP server instead of accessing it locally and them sending it there?
Thanks in advance!