我刚刚开始做示例应用程序,只调用我的sqlite数据库上的一些表,我已设法解决发生在我身上的其他问题,除了这个!虽然我搜索了关于连接字符串和权限问题的建议解决方案,并且所有似乎对我的许可似乎无效,我添加了所有用户完全控制并仍然相同的错误.下面是我试图执行的代码:
// calling function
void getrecords2()
{
MySqlLite.DataClass ss = new MySqlLite.DataClass();
DataTable dt = ss.selectQuery("select * from english_words");
}
//the SQLite class that execute the code
using System.Data;
using System.Data.SQLite;
namespace MySqlLite
{
class DataClass
{
private SQLiteConnection sqlite;
public DataClass()
{
//This part killed me in the beginning. I was specifying "DataSource"
//instead of "Data Source"
sqlite = new SQLiteConnection(@"Data Source=C:\testwork\db\MrPick.sqlite3.db;Version=3;FailIfMissing=True");
}
public DataTable selectQuery(string query)
{
SQLiteDataAdapter ad;
DataTable dt = new DataTable();
try
{
SQLiteCommand cmd; …Run Code Online (Sandbox Code Playgroud)