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
)
相關文章
- fatal: Authentication failedAI
- Authentication failed!nullAINull
- MediaRecorder start failed -19 java.lang.RuntimeException: start failedAIJavaException
- Gradle sync failed: Cause: dl.google.com:443 failed to respondGradleAIGo
- Injection of autowired dependencies failed;AI
- request gap sequence is FailedAI
- [ERROR] Failed to open logErrorAI
- Prerequisite check "CheckActiveFilesAndExecutables" failedUIAI
- how to clean failed crsAI
- Installation failed with message INSTALL_FAILED_USER_RESTRICTED錯誤AIREST
- fork failed - Cannot allocate memoryAI
- SDK Manager:failed to installAI
- Generating Pods project failedProjectAI
- Gradle Project Sync FailedGradleProjectAI
- OPatch failed with error code 73AIError
- app:processReleaseResources, Failed to execute aaptAPPAIAPT
- 【kylin】Failed to build cubeAIUI
- linker command failedAI
- Failed to create or upgrade OLRAI
- adoacorectl.sh FailedAI
- FAILED_LOGIN_ATTEMPTSAI
- GUI quick cut and paste failedGUIASTAI
- Starting HAL daemon:[FAILED]AI
- RAC User Equivalence Check FailedUIAI
- SSH Host key verification failedAI
- 【ERROR】OPatch failed with error code 73ErrorAI
- jupyter-kernelRestart:restart failedRESTAI
- SourceTree 提示 fatal: Authentication failed for..AI
- Execution failed for task ‘:demo:stripReleaseDebugSymbols‘.AISymbol
- Execution failed for task ‘:app:processDebugResources‘.AIAPP
- Arch更新時failed to prepare transactionAI
- [VRDevice] Initialization of device oculus failed.VRdevAI
- idapython import 'site' failedPythonImportAI
- pyenv BUILD FAILED解決方法UIAI
- open failed: EBUSY (Device or resource busy)AIdev
- BUG:Failed to create or upgrade OLRAI
- Clean up a failed CRS installAI
- Error: failed PB timebomb checkErrorAI