SqlCommand.DeriveParameters failed
错误信息例如以下:
SqlCommand.DeriveParameters failed because the SqlCommand.CommandText property value is an invalid multipart name "SELECT * from tableA", the current limit of "4" is insufficient。
错误原因:
使用Enterprise Library进行数据库操作时,假设直接使用sql 语句而非存储过程。一定要用重载方法:
_db.ExecuteDataSet(CommandType type,String sql)
而不是:
public virtual DataSet ExecuteDataSet(
string storedProcedureName,
params Object[] parameterValues
)
具体介绍:点击打开链接
或者通过sql,获取到DbCommand,再运行:
watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />
ExecuteDataSet重载方法例如以下:
Database.ExecuteDataSet Method (DbCommand)
public virtual DataSet ExecuteDataSet(
DbCommand command
)
Database.ExecuteDataSet Method (CommandType, String)
public virtual DataSet ExecuteDataSet(
CommandType commandType,
string commandText
)
Database.ExecuteDataSet Method (DbCommand, DbTransaction)
public virtual DataSet ExecuteDataSet(
DbCommand command,
DbTransaction transaction
)
Database.ExecuteDataSet Method (String, Object[])
public virtual DataSet ExecuteDataSet(
string storedProcedureName,
params Object[] parameterValues
)
Database.ExecuteDataSet Method (DbTransaction, CommandType, String)
public virtual DataSet ExecuteDataSet(
DbTransaction transaction,
CommandType commandType,
string commandText
)
Database.ExecuteDataSet Method (DbTransaction, String, Object[])
public virtual DataSet ExecuteDataSet(
DbTransaction transaction,
string storedProcedureName,
params Object[] parameterValues
)
SqlCommand.DeriveParameters failed的更多相关文章
- 浅析ado.net获取数据库元数据信息 DeriveParameters
写这个文章源于早先对ADO.Net获取数据库元数据上的认识,去年我在阅读ADO.Net Core Reference的时候曾经注意过DataSet的FillSchema的这个方法.这方面,在我之前的随 ...
- Retrieving failed records after an SqlBulkCopy exception
Let me start by saying that the idea I used in this article is not originally mine, but since I have ...
- [springMVC - 1A] - Request processing failed; nested exception is org.apache.ibatis.builder.IncompleteElementException
一月 14, 2016 1:30:07 下午 org.apache.catalina.core.StandardWrapperValve invoke严重: Servlet.service() for ...
- ADO.NET基础知识学习(SQLCOnnection&SQLCommand&SQLDataReader&SQLDataAdapter&DataSet)
通过ADO.NET技术,我们可以高效的完成客户端同数据库之间的数据访问操作,便于我们在客户端程序简便高效的访问以及获取数据库中的有用数据,同时也可以对数据库中的数据进行更新,即可以完成客户端与数据库之 ...
- Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define ...
Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define ... 这个错误是因为有两个相 ...
- Android Studio:Failed to resolve ***
更换电脑后,也更新了所有的SDK的tool,仍然报错:Failed to resolve 各种jar包,出现这种问题主要是因为在Android studio中默认不允许在线更新,修改方法如下:
- PMON failed to acquire latch, see PMON dump
前几天,一台Oracle数据库(Oracle Database 10g Release 10.2.0.4.0 - 64bit Production)监控出现"PMON failed to a ...
- [异常解决] windows用SSH和linux同步文件&linux开启SSH&ssh client 报 algorithm negotiation failed的解决方法之一
1.安装.配置与启动 SSH分客户端openssh-client和openssh-server 如果你只是想登陆别的机器的SSH只需要安装openssh-client(ubuntu有默认安装,如果没有 ...
- Failed to stop iptables.service: Unit iptables.service not loaded.
redhat 7 [root@lk0 ~]# service iptables stop Redirecting to /bin/systemctl stop iptables.service Fai ...
随机推荐
- 谷歌浏览器(chrome) —— 扩展应用程序
工具的使用--谷歌浏览器(chrome) (二) 1. 设置和下载方法 右上角菜单按钮 ⇒ 更多工具(more tools) ⇒ 扩展(Extensions) 打开该页面之后,会首先进入扩展(已安装应 ...
- 【Codeforces 258B】 Sort the Array
[题目链接] http://codeforces.com/contest/451/problem/B [算法] 模拟 在序列中找到一段单调递增的子序列,将这段序列反转,然后判断序列是否变得单调递增,即 ...
- gitlab quickly install
一.安装gitlab依赖环境 yum -y install vim wget epel-release yum install curl policycoreutils openssh-server ...
- angular中的ng-click指令案例
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- boost_1_63_0在Win10上VS2015编译
装了个最新版的boost库,各种尝试,各种看网上的文章,然而就是没有编译成功.我真是哭晕在厕所. 最后还是自己老老实实啃官方文档.终于编出来了.下面记录下方法. 一·最简单的一种方法. 1.直接打开命 ...
- matplotlib显示中文字体
原始地址:http://zanyongli.i.sohu.com/blog/view/195716528.htm matplotlib 1.0.0版 对于3.0的可能不太适用,要注意语法结构! C:/ ...
- 3 Python+Selenium的元素定位方法(id、class name、name、tag name)
[环境] Python3.6+selenium3.0.2+IE11+Win7 [定位方法] 1.通过ID定位 方法:find_element_by_id('xx') 2.通过name定位 方法:fin ...
- (转)RabbitMQ学习之路由(java)
http://blog.csdn.net/zhu_tianwei/article/details/40887755 参考:http://blog.csdn.NET/lmj623565791/artic ...
- concurrently - npm 同时运行前端和后台服务
项目基于vue(前端)+node(后台),需要启动两个服务 0.文件夹结构及package.json内容: 1.客户端 npm run dev 2.服务器 cd server npm run serv ...
- springboot-简介
SpringBoot是Spring项目中的一个子工程,与我们所熟知的Spring-framework 同属于spring的产品: 下载地址: Spring Boot 主要目标是: 为所有 Spring ...