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 ...
随机推荐
- libevent源码分析:listener
listener是libevent封装的一个方便生成监听者的一组结构和函数,其中包括: /* * Copyright (c) 2000-2007 Niels Provos <provos@cit ...
- AngularJS使用指南
ng-app 定义一个AngularJS应用程序 ng-model 把元素值绑定到AngularJS应用程序 ng-blind 把AngularJS应用程序数据绑定到HTML视图上 ng-init 初 ...
- Android开发工具类
7种无须编程的DIY开发工具 你知道几个? 现如今,各种DIY开发工具不断的出现,使得企业和个人在短短几分钟内就能完成应用的创建和发布,大大节省了在时间和资金上的投入.此外,DIY工 具的出现,也帮助 ...
- sql存储过程比sql语句执行慢很多
参数嗅探的问题 原因:(1)可能是发生了参数嗅探,第一次赋给存储过程的输入参数,会为该存储过程生成一个基于输入参数的执行计划,因此如果第一次输入的参数不具有代表性(例如大部分查询输入的参数都是A值,但 ...
- Mifare系列6-射频卡与读写器的通信(转)
文/闫鑫原创转载请注明出处http://blog.csdn.net/yxstars/article/details/38085415 1. 复位应答(Answer to request) 读写器呼叫磁 ...
- 《简明python教程》笔记二
面向对象的编程: 类和对象是面向对象编程的两个主要方面.类创建一个新类型,而对象是这个类的实例.对象可以使用普通的属于对象的变量存储数据.属于一个对象或类的变量被称为域.对象也可以使用属于类的函数来具 ...
- NHibernate Query
1) Sql Group by .... 之前是这么写的,因为DateTime是YYYY-MM-DD HH:mm:SS 模式,我只想group 日期.这种写法再mysql,sqlserver.orac ...
- JavaScript中关于地址的获取
//取当前页面名称(不带后缀名) function pageName(){ var a = location.href; var b = a.split("/"); var c = ...
- [SoapUI] 在SoapUI里用Java语言判断Excel单元格为空或者Null时出错
我取Excel数据时先判断cell是否为"": if(cellValue != ""){ listNumber.add(i); cellValu ...
- SQL SERVER与SSIS 数据类型对应关系