利用 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.的更多相关文章

  1. 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 = ...

  2. 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 ...

  3. 解决 'Could not convert variant of type (NULL) into type (String)

    写存储过程中有不允许为空的字段,在客户端转化取数时显示 Could not convert variant of type (NULL) into type (String) 可以在存储过程中使用is ...

  4. 无法将类型“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 ...

  5. mongolass 中报 ($.content: "say Hi ~") ✖ (type: String)

    第二次报这个错了, 一直以为MongoDB的模型用的type 是 String, 一直报错, 找不到原因. // 留言模型1 exports.Comment = mongolass.model('Co ...

  6. (type interface {}) to type string

    go 语言开发中,经常会在函数中碰到使用 insterface{} 作为接收任意参数,但是我们接收的数据经常是需要做类型转换,由于是初学者,因此,初次转换我是直接就 func New(paramete ...

  7. 报错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 ...

  8. 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 ...

  9. 记录一个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 ...

随机推荐

  1. Maven的安装配置

    本文主要是针对mac os系统下maven的安装教程. 1.首先验证是否有jdk.java -version,没有需要手工安装 2.maven的下载地址:http://maven.apache.org ...

  2. 【前端】Three.js

    Three.js 基本概念 渲染器(Renderer) 渲染器将和Canvas元素进行绑定 场景(Scene) 在Three.js中添加的物体都是添加到场景中的,因此它相当于一个大容器.一般说,场景里 ...

  3. web前端之html5开发中常用的开发工具

    正所谓“工欲善其事,必先利其器”,对Web开发人员来说,好工具的使用总会给人带来事半功倍的效果.正准备学习HTML5或者已经进行了一段时间的HTML5开发的童鞋,都有必要了解下,HTML5都有哪些开发 ...

  4. LMAX Disruptor—多生产者多消费者中,消息复制分发的高性能实现

    解决的问题 当我们有多个消息的生产者线程,一个消费者线程时,他们之间如何进行高并发.线程安全的协调? 很简单,用一个队列. 当我们有多个消息的生产者线程,多个消费者线程,并且每一条消息需要被所有的消费 ...

  5. CSS 如何使DIV层水平居中

    今天用CSS碰到个很棘手的问题,DIV本身没有定义自己居中的属性, 网上很多的方法都是介绍用上级的text-align: center然后嵌套一层DIV来解决问题. 可是事实上这样的方法科学吗? 经过 ...

  6. HackPwn2015:IoT智能硬件安全威胁分析

    HackPwn2015:IoT智能硬件安全威胁分析 360安全卫士 · 2015/08/26 14:43 IoT(物联网)是一种既危险又有趣的混合技术,所谓的混合技术包括移动应用程序.蓝牙.Wi-Fi ...

  7. python成长之路【第十四篇】:HTML初步认识

    HTML介绍 HTML是负责描述文档语义的语言.它是纯文本文件,用一些标签来描述文字的语义,这些标签在浏览器里面是看不到的,所以称为"超文本".所以就是"超文本标记语言& ...

  8. Thread.join()方法

    thread.Join把指定的线程加入到当前线程,可以将两个交替执行的线程合并为顺序执行的线程.比如在线程B中调用了线程A的Join()方法,直到线程A执行完毕后,才会继续执行线程B.t.join() ...

  9. win7配置ftp服务

    1.首先开启ftp服务 2.配置ftp站点 3.让ftp服务器通过防火墙 4.编辑ftp访问权限,使用户能通过账号密码访问ftp,当然,在此之前,需要创建一个新的用户 到此,就可以远程访问ftp了

  10. CMD 规范是不是就是 commonJS 规范?

    作者:giscafer链接:https://www.zhihu.com/question/20576942/answer/58094030来源:知乎著作权归作者所有,转载请联系作者获得授权. CMD是 ...