我有a .NET 4.5 application个正在启动和运行.此应用程序可以连接到SQL Server和MS Access数据库文件.
现在,我想使用一个SQLite数据库.
因此,我从this link下载了SQLite ADO.NET4.5数据提供程序(101),并将其安装在我的笔记本电脑上.
我的连接字符串如下:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="assemblies" type="Simple.Framework.AssembliesConfigurationSection, Simple.Framework"/>
</configSections>
<connectionStrings>
<!--<add name="MyMSAccessConnStr"
connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\DB\access_db_file.mdb;Persist Security Info=False"
providerName="System.Data.OleDb"/>-->
<!--<add name="MySQLServerConnStr" connectionString="Data Source=.\sqlexpress;Initial Catalog=gre;Integrated Security=True"
providerName="System.Data.SqlClient"/>-->
<add name="MySQLiteConnStr" connectionString="Data Source=C:\DB\sqlite_db_file.db;Version=3;"
providerName="System.Data.SQLite"/>
</connectionStrings>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/></startup>
</configuration>
在上面的代码中,MyMSAccessConnStr
和MySqlServerConnStr
已经可以正常工作了.
但是,SQLite连接不起作用.它显示以下错误:
An unhandled exception of type 'System.ArgumentException' occurred in System.Data.dll
Additional information: Unable to find the requested .Net Framework Data Provider.
It may not be installed.
我也没有在广汽中看到System.Data.Sqlite
.
我如何解决此问题?