我的项目有一个对SQLite.Interop.066.dll的引用,甚至在将SQLite数据库放入正确的路径后,应用程序仍然无法找到它。 A返回SQLiteException was unhandled
。错误:无法打开数据库文件,SQLiteException未处理
SQLiteConnection conn = new SQLiteConnection();
//SQLiteDataAdapter da;
SQLiteCommandBuilder cb;
DataTable dt=new DataTable();
int row = 0;
conn.ConnectionString = "Data Source=C:\\database\\info.db; Version=3";
conn.Open();
DataRow dr = dt.NewRow();
dr["name"] = txtName.Text;
dr["address"] = txtAddress.Text;
dr["phone"] = txtPhone.Text;
dr["position"] = txtPosition.Text;
dt.Rows.Add(dr);
da.Update(dt);
row = dt.Rows.Count - 1;
txtName.Text = dt.Rows[row]["name"].ToString();
txtAddress.Text = dt.Rows[row]["address"].ToString();
txtPhone.Text = dt.Rows[row]["phone"].ToString();
txtPosition.Text = dt.Rows[row]["position"].ToString();
da.Fill(dt);
cb = new SQLiteCommandBuilder(da);
conn.Dispose();
conn.Close();
在行上发生异常:conn.Open();
对不起之前的错误标题错误...
你有什么试过的?这个错误出现在什么情况/上下文中? –
请显示一些代码... –
对不起,没有更多的细节帮助。 – CouncilScribe