English 中文(简体)
Sqlite NET和实体框架——“试图撰写只读的数据库”
原标题:Sqlite .NET and Entity Framework - "attempt to write a readonly database"

纽约总部 我是否可提供任何补充资料帮助解决这一问题?

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.

最佳回答

突出的问题是国际空间法学会的安全环境。 我不得不转手书写字,而且很奇怪,它已经开始工作。

问题回答

暂无回答




相关问题
sqlite3 is chopping/cutting/truncating my text columns

I have values being cut off and would like to display the full values. Sqlite3 -column -header locations.dbs " select n.namelist, f.state, t.state from names n left join locations l on l.id = n.id ...

Entity Framework with File-Based Database

I am in the process of developing a desktop application that needs a database. The application is currently targeted to SQL Express 2005 and works wonderfully. However, I m not crazy about having ...

Improve INSERT-per-second performance of SQLite

Optimizing SQLite is tricky. Bulk-insert performance of a C application can vary from 85 inserts per second to over 96,000 inserts per second! Background: We are using SQLite as part of a desktop ...

Metadata for columns in SQLite v2.8 (PHP5)

How can I get metadata / constraints (primary key and "null allowed" in particular) for each column in a SQLite v2.8 table using PHP5 (like mysql_fetch_field for MySql)? sqlite_fetch_column_types (OO:...

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签