I have a lot of commands in the compact database like
using(SqlCeConnection connection= new SqlCeConnection(connectionstring)) { connection.Open(); using(SqlCeCommand cmd = new SqlCeCommand(commandText, connection)) { cmd.ExecuteScalar(); } using(SqlCeCommand cmd2 = new SqlCeCommand(commandText, connection)) { cmd2.ExecuteScalar(); } } }
And I have many of this modules and everything works, but in one point i get an error of file sharing violation of the database .sdf how can I terminate the process to relieve the database? Before I do this last procedure on the database that gets the error, i tried to verify if the connection is Open but it's not, it's closed, so i i don't have any ideas, can someone help me?