本文介绍了适用于 Windows 运行时的 SQLite 正在返回“只读"错误 SQLiteException 对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Windows 运行时的 SQLite 在我的 SQLite 数据库中插入新记录时返回只读"错误 SQLiteException 对象.

SQLite for Windows Runtime is returning an "ReadOnly" error SQLiteException object while inserting a new record in my SQLite database.

我不确定是什么原因造成的,但这个只读"错误是我得到的

I am not sure what's causing it but this "ReadOnly" error is what I got

我尝试更新数据库安全性,甚至蹩脚地添加了每个人"以确保,但我仍然收到该错误.知道为什么吗?

I tried to update the database security and even lamely added "Everyone" to make sure but I still get that error. Any idea why?

推荐答案

应用程序文件无法更改,因此您会看到只读"错误.将文件复制到 LocalFolder 是正确的,应用程序将在其中拥有完全的读写访问权限.

Application files cannot be changed, hence the "Read-Only" error you are seeing. You are correct instead to copy the file to the LocalFolder, where the application will have full read-write access.

如果您需要最初用数据填充数据库,您可以在将文件添加到 Visual Studio 中的项目之前或在数据库位于 LocalFolder 之后执行此操作.

If you need to populate your db with data initially, you can do this either prior to adding the file to the project in Visual Studio, or after the db is in the LocalFolder.

这篇关于适用于 Windows 运行时的 SQLite 正在返回“只读"错误 SQLiteException 对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 16:49