Quantcast
Channel: Visual Studio General Questions forum
Viewing all articles
Browse latest Browse all 21115

C# file sharing violation .sdf Sql comapact

$
0
0

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?



Viewing all articles
Browse latest Browse all 21115

Trending Articles