纽约总部 我是否可提供任何补充资料帮助解决这一问题?
I m试图在NET WCF网络服务范围内启动和操作Sqlite和实体框架。
当我试图将任何东西节省到数据库时,Im 发现错误“企图书写只读的数据库。 这里的错误信息是:
System.Data.EntityException: An error occurred while starting a transaction on the provider connection. See the inner exception for details.
---> System.Data.SQLite.SQLiteException: Attempt to write a read-only database
Attempt to write a readonly database
at System.Data.SQLite.SQLite3.Reset(SQLiteStatement stmt)
at [snip]........................................................> at System.Data.EntityClient.EntityConnection.BeginDbTransaction(IsolationLevel isolationLevel) at System.Data.Common.DbConnection.BeginTransaction() at System.Data.EntityClient.EntityConnection.BeginTransaction() at System.Data.Objects.ObjectContext.SaveChanges(Boolean acceptChangesDuringSave) at System.Data.Objects.ObjectContext.SaveChanges() at ...
我的EF配置在网上。
<connectionStrings>
<add
name="FooEntities"
connectionString="metadata=res://*/FooDataModel.csdl|
res://*/FooDataModel.ssdl|
res://*/FooDataModel.msl;
provider=System.Data.SQLite;
provider connection string= data source=C:domainsmyfoosite.comwwwrootFooServiceFoo.sqlite "
providerName="System.Data.EntityClient" />
<connectionStrings>
为什么我收到这一错误? 为什么数据库只读取?
我尝试的一些事情:
Ensured the directory and file is write-able by the web service. (I ve tried writing plain text files to the same directory as a test.)
I ve added the read only=False to the connection string.