I changed the dispose of connection like this:
// Force any commands associated with this connection to release their unmanaged
// resources. The commands are still valid and will automatically re-acquire the
// unmanaged resources the next time they are run -- provided this connection is
// re-opened before then.
while (_commandList.Count > 0)
{
foreach (SQLiteCommand cmd in _commandList)
{
cmd.ClearCommands();
break;
}
}
This with this code the "foreach" of the dispose gave me an exception :
using (cnn = new SQLiteConnection())
{
try
{
cnn.ConnectionString = NxGeneral.CFGSOURCE;
string s = "......";
cnn.Open();
using (SQLiteCommand CM = new SQLiteCommand(cnn))
{
CM.CommandText = s;
SQLiteDataReader R = CM.ExecuteReader();
if (R.Read())
{
return R.GetString(0);
}
else
{
return "";
}
}
}
catch (SQLiteException s)
}