错误为:
- The error occurred while load DataBase Provider.
- The error occurred in <provider name="oracleClient1.0">.
- Check the oracleClient1.0.
"Error while configuring the Provider named \"oracleClient1.0\". Cause : The provider is not in 'providers.config'."
我的配置文件SQLMAP.conf为:
- <?xml version="1.0" encoding="utf-8"?>
- <sqlMapConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SqlMapConfig.xsd">
- <settings>
- <setting useStatementNamespaces="false"/>
- <setting cacheModelsEnabled="true"/>
- </settings>
- <providers resource="providers.config"/>
- <database>
- <provider name="oracleClient1.0" />
- <dataSource name="customer" connectionString="Data Source=itdevLoal;user=east;password=east"/>
- </database>
- <sqlMaps>
- <sqlMap resource="maps/Person.xml"/>
- </sqlMaps>
- </sqlMapConfig>
<?xml version="1.0" encoding="utf-8"?> <sqlMapConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SqlMapConfig.xsd"> <settings> <setting useStatementNamespaces="false"/> <setting cacheModelsEnabled="true"/> </settings> <providers resource="providers.config"/> <database> <provider name="oracleClient1.0" /> <dataSource name="customer" connectionString="Data Source=itdevLoal;user=east;password=east"/> </database> <sqlMaps> <sqlMap resource="maps/Person.xml"/> </sqlMaps> </sqlMapConfig>
其中providers.config文件在根目录下和bin/Debug目录下都有
- <provider
- name="oracleClient1.0"
- description="Oracle, Microsoft provider V1.0.5000.0"
- enabled="false"
- default="false"
- assemblyName="System.Data.OracleClient, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
- connectionClass="System.Data.OracleClient.OracleConnection"
- commandClass="System.Data.OracleClient.OracleCommand"
- parameterClass="System.Data.OracleClient.OracleParameter"
- parameterDbTypeClass="System.Data.OracleClient.OracleType"
- parameterDbTypeProperty="OracleType"
- dataAdapterClass="System.Data.OracleClient.OracleDataAdapter"
- commandBuilderClass="System.Data.OracleClient.OracleCommandBuilder"
- usePositionalParameters = "false"
- useParameterPrefixInSql = "true"
- useParameterPrefixInParameter = "false"
- parameterPrefix=":"
- />
<provider name="oracleClient1.0" description="Oracle, Microsoft provider V1.0.5000.0" enabled="false" default="false" assemblyName="System.Data.OracleClient, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" connectionClass="System.Data.OracleClient.OracleConnection" commandClass="System.Data.OracleClient.OracleCommand" parameterClass="System.Data.OracleClient.OracleParameter" parameterDbTypeClass="System.Data.OracleClient.OracleType" parameterDbTypeProperty="OracleType" dataAdapterClass="System.Data.OracleClient.OracleDataAdapter" commandBuilderClass="System.Data.OracleClient.OracleCommandBuilder" usePositionalParameters = "false" useParameterPrefixInSql = "true" useParameterPrefixInParameter = "false" parameterPrefix=":" />
查了一天,就是不明白为什么会抛这样的错误。。。
请各位指点一下迷津吧。。。。非常感谢!!
解决方法:enabled="false" 改为 true