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,再执行:

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
)
时间: 2024-09-19 08:52:17

SqlCommand.DeriveParameters failed的相关文章

Starting MySQL.Manager of pid-file quit without updating file.[FAILED]

Starting MySQL...... ERROR! Manager of pid-file quit without updating file. 可选拍错思路: my.cnf 配置文件参数错误. 刚装完MySQL,启动时报如下错误: Starting MySQL.Manager of pid-file quit without updating file.[FAILED] 依次尝试了从谷姐找到的各种方法,发现只要执行如下MySQL初始化命令即可解决: 1 /usr/local/mysql/

ksvcreate: Process(m000) creation failed

一测试服务器数据库(Oracle Database 10g Release 10.2.0.5.0 - 64bit Production)突然访问不了,检查发现数据库处于挂起模式(hang mode),检查告警日志,发现有"ksvcreate: Process(m000) creation failed","kkjcre1p: unable to spawn jobq slave process"之类的错误信息.具体如下所示: Sun Jan 17 09:56:05

Re-installation failed due to different application signatures.

问题: 在虚拟设备上运行程序时提示安装失败.  [2010-08-08 00:38:30 - myApp] Re-installation failed due to different application signatures. [2010-08-08 00:38:30 - myApp] You must perform a full uninstall of the application. WARNING: This will remove the application data!

Call to master/192.168.137.101:9001 failed on connection exception: java.net.ConnectException: Connection refused

java.net.ConnectException: Call to master/192.168.137.101:9001 failed on connection exception: java.net.ConnectException: Connection refused  at org.apache.hadoop.ipc.Client.wrapException(Client.java:1099)  at org.apache.hadoop.ipc.Client.call(Client

安装软件出现failed to expand shell folder constant “userdocs”的解决方法

  安装软件时出现错误提示failed to expand shell folder constant "userdocs",如图: 解决方法: 点"开始"-"运行"(或Windows键+R)输入 regedit 回车,在弹出的注册表编辑器中左侧依次展开: HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerUser Shell Folders 在右侧找到personal,

unity5.3.4p3 getthreadcontext failed如何解决

问题描述 unity5.3.4p3 getthreadcontext failed如何解决 2C unity5.3.4p3 getthreadcontext failed如何解决,在网上找了一大堆,有的说是和windows7 64位有关,有的说和相机挂脚本有关,有的说是杀毒软件引起的,有人知道哪里出的问题吗?坐等....... 解决方案 那网上说的方法你都试了没有或者说你只是看看而没有试 解决方案二: 正在试中,同时问问,看看有人遇到过没有网上看到的也不是解决方案

Tomcat7+Spring3异常Failed to start component

我做的一个考试系统,使用了hibernate和spring,原来使用的tomcat版本是6,后来把tomcat换成了apache-tomcat-7.0.30-windows-x64,spring的版本是:3.1 结果启动tomcat时报错如下: .6. Feb 27, 2013 12:18:00 AM org.apache.catalina.core.AprLifecycleListener init INFO: APR capabilities: IPv6 [true], sendfile [

Custom tool error: Failed to generate code for the service reference ××××××. Please check other erro

开发工具:VS2010 问题描述: 在ProjectName.Web中创建的WebService服务,然后在项目中添加Add Service Reference,然后就报"Custom tool error: Failed togenerate code for the service reference ××××××. Please check other error andwarning messages for details. "这样的错误  新建.调用WebService 解

关于nginx 出现accept4() failed错误问题

问题描述 关于nginx 出现accept4() failed错误问题 nginx作代理,用ab去压的时候(比如:ab -n 100000 -c 100000),没过多久ab反馈拒绝连接了,然后看到任务管理器中有一个nginx进程一直占用着CPU(如果是双核就占50%,换了一台8核的,就占用12%左右),错误日志猛增,内容都是2015/01/28 10:43:22 [alert] 11180#0: accept4() failed (22: Invalid argument) 这样的,若把ab的