数据库
首页 > 数据库> > Error while configuring the Provider named “MySql“. Cause : The provider is not in ‘providers.config

Error while configuring the Provider named “MySql“. Cause : The provider is not in ‘providers.config

作者:互联网

使用.NET+IBatics.net连接Mysql时,提示错误:
Error while configuring the Provider named “MySql”. Cause : The provider is not in 'providers.config

经过查找总结方法如下:
1、下载一个Mysql.Data.dll,并引用;
2、修改Provider.config文件,看是否存在MySql的配置项目,如果没有则添加。
3、将Provider.config文件中MySql的配置设置:enabled=“true”
4、检查下载的dll文件与配置项是否一致,不一致则修改配置。
完整的配置项如下:

  <provider
		name="MySql"
		description="MySQL, MySQL provider V8.0.20.0"
		enabled="true"
		assemblyName="MySql.Data, Version=8.0.20.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"
		connectionClass="MySql.Data.MySqlClient.MySqlConnection"
		commandClass="MySql.Data.MySqlClient.MySqlCommand"
		parameterClass="MySql.Data.MySqlClient.MySqlParameter"
		parameterDbTypeClass="MySql.Data.MySqlClient.MySqlDbType"
		parameterDbTypeProperty="MySqlDbType"
		dataAdapterClass="MySql.Data.MySqlClient.MySqlDataAdapter"
		commandBuilderClass="MySql.Data.MySqlClient.MySqlCommandBuilder"
		usePositionalParameters = "false"
		useParameterPrefixInSql = "true"
		useParameterPrefixInParameter = "true"
		parameterPrefix="@"
	/>

标签:named,配置,configuring,providers,Provider,MySql,config
来源: https://blog.csdn.net/weixin_42835568/article/details/123105202