我试图让SQLite运行在C#的Visual Studio 2012中。 但是,经过一组教程后,我仍然得到SQLite.Interop.dll错误DllNotFoundException。DllNotFoundException for SQLite.Interop.dll(C#&SQLite)
这是完全错误我收到:
无法加载DLL 'SQLite.Interop.dll':指定的路径 无效。 (异常来自HRESULT:0x800700A1)
我已经创建了System.Data.SQLite.dll的引用。现在我发现我必须将SQLite.Interop.dll文件添加到我的项目文件夹中,但仍然出现此错误。
哦,顺便说一句,这是我的代码,如果有人有兴趣:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SQLite;
namespace SQLiteWinFormCS
{
public partial class Form1 : Form
{
private SQLiteConnection _sqlCon;
private SQLiteCommand _sqlCmd;
private SQLiteDataAdapter _db;
private DataSet _ds = new DataSet();
private DataTable _dt = new DataTable();
private string _dbPath = String.Empty;
public Form1()
{
InitializeComponent();
}
private void uiOpenDB_Click(object sender, EventArgs e)
{
Console(String.Format("You clicked {0}.", ((Button)sender).Name));
this._dbPath = uiDatabaseFilepath.Text;
Console("Filepath to DB = " + this._dbPath);
Console("Attempting to open DB connection...");
this._sqlCon = new SQLiteConnection(String.Format("Data Source={0};", @"\\Some-PC\ISC\Databases\testdbs\test.db3")); // << ERROR
Console("DB connection succesfull!");
}
private void Console(string text)
{
uiConsoleOutput.AppendText(text);
uiConsoleOutput.ScrollToCaret();
}
}
}
谁能帮我把这个东西的工作?
在此先感谢。