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" />
都正常了
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" />
都正常了
相关文章推荐
- The type Database cannot be constructed. You must configure the container to supply this value.
- could not be set to a 'string' value. You must set this property to a non-null value of type
- Multiple annotations found at this line: - String cannot be resolved to a type - The method getConte
- org.json.JSONException: Value of type java.lang.String cannot be converted to JSON
- org.json.JSONException: Value of type java.lang.String cannot be converted to JSONArra
- Eclipse的JSP页面提示Multiple annotations found at this line或者String cannot be resolved to a type
- Eclipse的JSP页面提示Multiple annotations found at this line或者String cannot be resolved to a type
- Value of type java.lang.String cannot be converted to JSONObject
- To log onto this remote computer, you must be granted the Allow Log on through Terminal Services Right.
- Eclipse的JSP页面提示Multiple annotations found at this line或者String cannot be resolved to a type
- org.json.JSONException: Value ok of type java.lang.String cannot be converted to JSONObject:
- Err:The "." operator was supplied with an index value of type "java.lang.String" to be applied to a List or array
- Value of type java.lang.String cannot be converted to JSONObject
- JSONException: Value of type java.lang.String cannot be converted to JSONObject
- Multiple annotations found at this line: - String cannot be resolved to a type
- Json解析异常处理方式(JSONException: Value of type java.lang.String cannot be converted to JSONObject)
- org.json.JSONException: Value of type java.lang.String cannot be converted to JSONArra
- Json解析异常处理方式(JSONException: Value of type java.lang.String cannot be converted to JSONObject)
- Json解析异常处理方式(JSONException: Value of type java.lang.String cannot be converted to JSONObject)
- String cannot be resolved to a type - The method getContextPath() from the type HttpServletRequest r