我的項目有一個對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