Microsoft.Practices.EnterpriseLibrary.Data.DLL but was not handled in user code

后端 未结 1 853
感动是毒
感动是毒 2021-02-19 06:35

Searched google and using Enterprise library data access to connect database.

Installed only data access pack using https://www.nuget.org/packages/EnterpriseLibrary.Data

相关标签:
1条回答
  • 2021-02-19 06:57

    Finally found the answer. It has been occurred because of the configuration section.

    I've used version 6, but here I've mentioned like version 5 in the configuration section. So the error has occurred.

    I've replaced the configuration section like following, It worked perfectly in good way. :-). Thanks a lot for the helpers.

    <configSections>
             <section name="dataConfiguration" 
          type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, 
                Microsoft.Practices.EnterpriseLibrary.Data"/>
        </configSections>
    

    and used DataBaseProviderFactory class to create instance.

    DatabaseProviderFactory factory = new DatabaseProviderFactory();
    
                db = factory.Create("dProvider");
    
    0 讨论(0)
提交回复
热议问题