嗨我在这个sqlite中得到错误 [英] hi iam getting error in this sqlite

查看:116
本文介绍了嗨我在这个sqlite中得到错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

代码背后代码







private void insertconnect_Click(object sender,EventArgs e)

{

// [snip] - 由于C#纯粹是面向对象的,因此必须将以下行放入类中:



//我们使用这三个SQLite对象:

SQLiteConnection sqlite_conn;

SQLiteCommand sqlite_cmd;

SQLiteDataReader sqlite_datareader;







sqlite_conn = new SQLiteConnection(); //创建对象的实例

sqlite_conn.ConnectionString =Data Source = c:\\ eminosoft.db; Version = 3; New = True; Compress = True;; //设置ConnectionString

sqlite_conn.Open(); //打开连接。现在你可以触发SQL-Queries



//创建一个新的SQL命令:

sqlite_cmd = sqlite_conn.CreateCommand();



}

code behind code



private void insertconnect_Click(object sender, EventArgs e)
{
// [snip] - As C# is purely object-oriented the following lines must be put into a class:

// We use these three SQLite objects:
SQLiteConnection sqlite_conn;
SQLiteCommand sqlite_cmd;
SQLiteDataReader sqlite_datareader;



sqlite_conn = new SQLiteConnection(); // Create an instance of the object
sqlite_conn.ConnectionString = "Data Source=c:\\eminosoft.db;Version=3;New=True;Compress=True;"; // Set the ConnectionString
sqlite_conn.Open(); // Open the connection. Now you can fire SQL-Queries

// create a new SQL command:
sqlite_cmd = sqlite_conn.CreateCommand();

}

推荐答案

您必须在其文件夹上设置读/写权限,而不仅仅是文件。



请参见此处。 [ ^ ]
You have to set read/write rights on its folder not just the file.

See here.[^]


我只解决了我的自我



错误是数据源= c:\\eminosoft.db;版本= 3;新=真;压缩=真;;





答案是@数据源= c:\ \\ \\我们必须走路径;版本= 3;新=真;压缩= TRUE;;

然后问题解决了
i only solved my self

error is "Data Source=c:\\eminosoft.db;Version=3;New=True;Compress=True;";


Answer is @"Data Source=c:\\here we have to take path;Version=3;New=True;Compress=True;";
then issue solved


这篇关于嗨我在这个sqlite中得到错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆