How do I share a SQL Server CE database file (

2020-02-15 04:19发布

问题:

I have a database in SQL Server CE. When connecting several applications of different computers to the database throw an exception.

This is the exception:

There is a file sharing violation. A different process might be using the file. type of exception is "SqlCeException".

and this is my connection string :

Data Source=\\server\ProductionDB\ProductionControl.sdf;File Mode=Read Write; Max Database Size = 4000

The version of SQL Server CE is 3.5 SP2

回答1:

I misread your question initially, but I don't believe SQL Server CE supports multiple connections from different computers.

From an MS guide:

When you require data service functionality, such as the ability to support multiple, remote users, you should start with SQL Server Express Edition and work up the data service family tree.

You can have multiple connections (up to 256) from the same machine, but connections from multiple machines requires SQL Express Edition. It's freely available and easy to deploy.

Here's the link: http://www.microsoft.com/sqlserver/en/us/editions/express.aspx