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
)

版权声明:作者:jiankunking 出处:http://blog.csdn.net/jiankunking 本文版权归作者和CSDN共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接。

时间: 2024-08-01 14:26:24

SqlCommand.DeriveParameters failed的相关文章

[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 servlet [springMVC] in context with path [/ExceptionManageSystem] threw exception [Request processing failed; nested exception is org.apache.ibatis.b

mysqld服务启动失败, Failed to restart mysqld.service: Unit not found.

-bash-4.2# service mysqld restart Redirecting to /bin/systemctl restart mysqld.serviceFailed to restart mysqld.service: Unit not found. 并不存在 mysqld 的服务, -bash-4.2# -bash-4.2# chkconfig -list -list: unknown option -bash-4.2# chkconfig --list Note: Thi

Spring Cloud ZooKeeper集成Feign的坑2,服务调用了一次后第二次调用就变成了500,错误:Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is com.n

错误如下: 2017-09-19 15:05:24.659 INFO 9986 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.spring[email protected]56528192: startup date [Tue Sep 19 15:05:24 CST 2017]; root of context hierarchy 2017-09-19 15:05:24.858 INFO 9986 --

Hive报错 Failed with exception java.io.IOException:java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: ${system:user.name%7D

报错信息如下 Failed with exception java.io.IOException:java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: ${system:user.name%7D 解决方法: 编辑 hive-site.xml 文件,添加下边的属性 <property> <name>system:java.io.tmpdir<

View Composer Agent initialization error (16): Failed to activate software license (1026556)

1.       桌面发布过程中偶尔有些桌面池中的桌面提示无法访问代理,查看报错信息如下:View Composer Agent initialization error (16):Failed to activate software license (1026556). KB地址:https://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&externalId=1026556 主要意思是Windows 7系统激活的

Maven Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean Failed to delete access_log

I'm trying to run simple struts project using maven and tomcat. When I'm trying to exucute next goals:clean install tomcat7:run ,there is an error : [ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean)

Applying GI PSU &quot;opatch auto&quot; fails with &quot;The opatch Component check failed&quot;

Applying GI PSU using "opatch auto" fails with "The opatch Component check failed" (文档 ID 1169036.1) APPLIES TO: Oracle Database - Enterprise Edition - Version 11.2.0.3 and laterInformation in this document applies to any platform.***C

启动hive报错[ERROR] Terminal initialization failed; falling back to unsupported

启动hive时报如下的错误[ERROR] Terminal initialization failed; falling back to unsupported 解决办法:进入到hadoop安装目录下的share/hadoop/yarn下删除 jline的jar文件.再启动hive即可 版权声明:本文为博主原创文章,未经博主允许不得转载.

Android Studio 中 FAILURE: Build failed with an exception. * What went wrong: Execution failed for task &#39;:compileDebugAidl&#39;.的问题解答

Android Studio 中 FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':compileDebugAidl'.的问题解答 完整的问题提示 Gradle: FAILURE:Build failed with an exception.*What went wrong:Execution failed for task ':compileDebugAidl'.>No