设为首页 加入收藏

TOP

EF sqlite3报错 "System.Data.Entity.Core.EntityException: 在提供程序连接上启动事务时出错。有关详细信息,请参阅内部异常。(一)
2017-10-16 18:19:47 】 浏览:2913
Tags:sqlite3 报错 " System.Data.Entity.Core.EntityException: 提供 程序 接上 启动 事务 出错 有关 详细 信息 参阅 内部 异常

问题:sqlite3使用ef框架操作数据库报错

问题原因:数据库文件没有访问权限

结局方案:可以将数据库文件所在的文件夹的访问权限添加Everyone用户权限。

 

错误:"System.Data.Entity.Core.EntityException: 在提供程序连接上启动事务时出错。有关详细信息,请参阅内部异常。 ---> System.Data.SQLite.SQLiteException: attempt to write a readonly database\r\nattempt to write a readonly database\r\n 在 System.Data.SQLite.SQLite3.Reset(SQLiteStatement stmt)\r\n 在 System.Data.SQLite.SQLite3.Step(SQLiteStatement stmt)\r\n 在 System.Data.SQLite.SQLiteDataReader.NextResult()\r\n 在 System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave)\r\n 在 System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior)\r\n 在 System.Data.SQLite.SQLiteCommand.ExecuteNonQuery(CommandBehavior behavior)\r\n 在 System.Data.SQLite.SQLiteCommand.ExecuteNonQuery()\r\n 在 System.Data.SQLite.SQLiteTransaction.Begin(Boolean deferredLock)\r\n 在 System.Data.SQLite.SQLiteTransactionBase..ctor(SQLiteConnection connection, Boolean deferredLock)\r\n 在 System.Data.SQLite.SQLiteTransaction..ctor(SQLiteConnection connection, Boolean deferredLock)\r\n 在 System.Data.SQLite.SQLiteConnection.BeginDbTransaction(IsolationLevel isolationLevel)\r\n 在 System.Data.Common.DbConnection.BeginTransaction(IsolationLevel isolationLevel)\r\n 在 System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.<BeginTransaction>b__0(DbConnection t, BeginTransactionInterceptionContext c)\r\n 在 System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)\r\n 在 System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.BeginTransaction(DbConnection connection, BeginTransactionInterceptionContext interceptionContext)\r\n 在 System.Data.Entity.Core.EntityClient.EntityConnection.<>c__DisplayClass6.<BeginDbTransaction>b__4()\r\n 在 System.Data.Entity.Infrastructure.DefaultExecutionStrategy.Execute[TResult](Func`1 operation)\r\n 在 System.Data.Entity.Core.EntityClient.EntityConnection.BeginDbTransaction(IsolationLevel isolationLevel)\r\n --- 内部异常堆栈跟踪的结尾 ---\r\n 在 System.Data.Entity.Core.EntityClient.EntityConnection.BeginDbTransaction(IsolationLevel isolationLevel)\r\n 在 System.Data.Entity.Core.EntityClient.EntityConnection.BeginTransaction()\r\n 在 System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)\r\n 在 System.Data.Entity.Core.Objects.ObjectContext.SaveChangesToStore(SaveOptions options, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction)\r\n 在 System.Data.Entity.Core.Objects.ObjectContext.<>c__DisplayClassb.<SaveChangesInternal>b__8()\r\n 在 System.Data.Entity.Infrastructure.DefaultExecutionStrategy.Execute[TResult](Func`1 operation)\r\n 在 System.Data.Entity.Core.Objects.ObjectContext.SaveChangesInternal(SaveOptions options, Boolean executeInExistingTransaction)\r\n 在 System.Data.Entity.Core.Objects.ObjectContext.SaveChanges(SaveOptions op

首页 上一页 1 2 下一页 尾页 1/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇FCL源码中数组类型的学习及排序函.. 下一篇"ServiceStack.Redis.RedisN..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目