The type String cannot be constructed. You must configure the container to supply this value.
利用 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" />
都正常了
The type String cannot be constructed. You must configure the container to supply this value.的更多相关文章
- swift2.0 Cannot assign a value of type '[CFString]' to a value of type '[String]'
Cannot assign a value of type '[CFString]' to a value of type '[String]' 代码示例如下: picker.mediaTypes = ...
- go语言byte类型报错cannot use "c" (type string) as type byte in assignment
练习Go修改字符串的时候遇到这个问题:cannot use "c" (type string) as type byte in assignment,代码如下: package m ...
- 解决 'Could not convert variant of type (NULL) into type (String)
写存储过程中有不允许为空的字段,在客户端转化取数时显示 Could not convert variant of type (NULL) into type (String) 可以在存储过程中使用is ...
- 无法将类型“System.Collections.Generic.List<anonymous type:string ClassID,string ClsssName>”隐式转换为“System.Collections.Generic.List<Ecology.Model.EnergyFlowGraph>”
无法将类型“System.Collections.Generic.List<anonymous type:string ClassID,string ClsssName>”隐式转换为“Sy ...
- mongolass 中报 ($.content: "say Hi ~") ✖ (type: String)
第二次报这个错了, 一直以为MongoDB的模型用的type 是 String, 一直报错, 找不到原因. // 留言模型1 exports.Comment = mongolass.model('Co ...
- (type interface {}) to type string
go 语言开发中,经常会在函数中碰到使用 insterface{} 作为接收任意参数,但是我们接收的数据经常是需要做类型转换,由于是初学者,因此,初次转换我是直接就 func New(paramete ...
- 报错The "chunk" argument must be one of type string or Buffer. Received type object
报错内容: TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be one of type string or ...
- The method format(String, Object[]) in the type String is not applicable for the arguments
今天,我弟遇到一个有意思的错误~ 程序: package com.mq.ceshi1; public class StringFormat { public static void main(Stri ...
- 记录一个EF连接查询的异常:the entity or complex type 'x' cannot be constructed in a linq to entities query
问题解决连接:https://stackoverflow.com/questions/5325797/the-entity-cannot-be-constructed-in-a-linq-to-ent ...
随机推荐
- 广播Broadcast Receiver
广播的类型: 1.标准广播(Normal broadcat) 完全异步执行的广播,所有广播接收器同一时间接收广播消息. 效率高,但无法被截断. 2.有序广播 同步执行的广播,同一时刻只能有一个广播接收 ...
- arguments的理解
(function(){ return typeof arguments; })(); 无聊的时候看看网上的面试题.个人认为通过面试题可以对某个知识点能够更加认识,踩过坑才会明白坑是有多大.代码中经常 ...
- MyEclipse10安装Svn插件的几种方法
http://blog.sina.com.cn/s/blog_4f925fc30102e9xe.html 方法一:直接解压 下载SVN插件:site-1.6.18.zip 解压后将其全部文件拷贝至:D ...
- Linux文件搜索命令
文件搜索命令:locate locate 文件名 在后台数据库中按文件名搜索,搜索速度很快(比find命令要快得多) locate命令所搜索的后台数据库的位置:/var/bin/mlocate 支持模 ...
- 框架整合----------Hibernate、spring整合
说到整合框架,其实也就是环境的搭建了,首先我们要导包,这里连接数据库我们用到了spring容器,我们用连接池来进行数据库的连接,我们需要导入c3p0和jdbc的jar包,其余的就是spring和Hib ...
- lightBox灯箱效果
最近想做一个类似QQ空间相册,点击照片会出现一个遮罩层,然后显示照片,可以左右切换照片,上网查了,原来叫灯箱效果,于是自己也写了一个简单的灯箱效果,并进行了简单封装,封装得不是很完善,后面还需要改进, ...
- cocos学习笔记:快速上手
cc.Class({ //奇怪的语法风格,cc.class, extends: cc.Component, //扩展自cc.Component properties: { //类的属性设置 jumpH ...
- CSS3盒子阴影box-shadow
来自W3CSchool的解释 语法: box-shadow: h-shadow v-shadow blur spread color inset; 注释:box-shadow 向框添加一个或多个阴影. ...
- MultipeerConnectivity框架,近场通信的基本使用
Multipeer connectivity是一个使附近设备通过Wi-Fi网络.P2P Wi-Fi以及蓝牙个人局域网进行通信的框架.互相链接的节点可以安全地传递信息.流或是其他文件资源,而不用通过网络 ...
- JQuery_处理元素和浏览器的窗口的尺寸
一.jQuery width() 和 height() 方法 width() 方法设置或返回元素的宽度(不包括内边距.边框或外边距). height() 方法设置或返回元素的高度(不包括内边距.边框或 ...