SqlCE on Shared network folder locks the sdf file

masud Hosseinian 21 Reputation points

I have a .net application that uses SqlCE. I can easily open the database and then go to the folder where the sdf file is located and make a copy of it(We do that to create backups when user requests it). When I try the same workflow using a shared network folder, i get shared file access error saying another process is using that file. Does sqlCE open the sdf file differently when the file is on a network folder?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,639 questions
{count} votes

Accepted answer
  1. CathyJi-MSFT 21,081 Reputation points Microsoft Vendor

    Hi @masud Hosseinian ,

    Although SQL Server Compact Edition supports concurrent database connections from multiple threads and multiple processes, concurrent access is not supported when the database file is located on a network drive. SQL Server Compact Edition prevents it by automatically acquiring an exclusive lock on the database file when a connection is made to the database file via a network share.

    If the response is helpful, please click "Accept Answer" and upvote it, as this could help other community members looking for similar queries.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful