SqlCommand.DeriveParameters failed

黄舟
Release: 2017-02-16 10:45:33
Original
1646 people have browsed it

The error message is as follows:


SqlCommand.DeriveParameters failed because the SqlCommand.CommandText property value is an invalid multipart name 
"SELECT * from tableA", the current limit of "4" is insufficient。
Copy after login


Error reason:

When using Enterprise Library for database operations, if you use SQL statements directly instead of stored procedures, you must use the overload method:
_db.ExecuteDataSet(CommandType type, String sql)

instead of:

public virtual DataSet ExecuteDataSet(
	string storedProcedureName,
	params Object[] parameterValues
)
Copy after login
Copy after login


Detailed introduction: Click to open the link


or get the Db through sql Command, then execute:


ExecuteDataSet overload method is as follows:

Database.ExecuteDataSet Method (DbCommand)

public virtual DataSet ExecuteDataSet(
	DbCommand command
)
Copy after login


Database.ExecuteDataSet Method ( CommandType, String)


public virtual DataSet ExecuteDataSet(
	CommandType commandType,
	string commandText
)
Copy after login


Database.ExecuteDataSet Method (DbCommand, DbTransaction)


public virtual DataSet ExecuteDataSet(
	DbCommand command,
	DbTransaction transaction
)
Copy after login


Database.Execute DataSet Method (String, Object[])


public virtual DataSet ExecuteDataSet(
	string storedProcedureName,
	params Object[] parameterValues
)
Copy after login
Copy after login

Database.ExecuteDataSet Method (DbTransaction, CommandType, String)


public virtual DataSet ExecuteDataSet(
	DbTransaction transaction,
	CommandType commandType,
	string commandText
)
Copy after login


Database.ExecuteDataSet Method (DbTransaction, String, Object[])


public virtual DataSet ExecuteDataSet(
	DbTransaction transaction,
	string storedProcedureName,
	params Object[] parameterValues
)
Copy after login


The above is the content of SqlCommand.DeriveParameters failed. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!




source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!