您的位置:首页 > 产品设计 > UI/UE

The type String cannot be constructed. You must configure the container to supply this value.

2016-10-26 10:26 851 查看
利用 Enterprise Library 5.0

Microsoft.Practices.EnterpriseLibrary.Common

Microsoft.Practices.EnterpriseLibrary.Data

Microsoft.Practices.ServiceLocation

引用都添加了

EnterpriseLibraryContainer.Current.GetInstance<SqlDatabase>("SQLConnString"); 运行到此处一直报错

The type String cannot be constructed. You must configure the container to supply this value.

后发现问题 出现在此:

<add name="SQLConnString" connectionString="server=127.0.0.1;database=ddbb;uid=dd;pwd=11;" />

再加上 providerName="System.Data.SqlClient"

<add name="SQLConnString" connectionString="server=172.20.20.13;database=ProjectDB;uid=sa;pwd=11;" providerName="System.Data.SqlClient" />

都正常了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐