我的项目引用了 SQLite.Interop.066.dll,即使在输入 SQLite 数据库的正确路径后,应用程序仍然无法找到它。ASQLiteException was unhandled
被退回。
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();
抱歉之前的错误标题错误...