过程或函数sp_Patch_InsertPatchDetails_New指定的参数过多 [英] Procedure or function sp_Patch_InsertPatchDetails_New has too many arguments specified

查看:60
本文介绍了过程或函数sp_Patch_InsertPatchDetails_New指定的参数过多的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at System.Data.Linq.SqlClient.SqlProvider.Execute(Expression query, QueryInfo queryInfo, IObjectReaderFactory factory, Object[] parentArgs, Object[] userArgs, ICompiledSubQuery[] subQueries, Object lastResult)
   at System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(Expression query, QueryInfo[] queryInfos, IObjectReaderFactory factory, Object[] userArguments, ICompiledSubQuery[] subQueries)
   at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query)
   at System.Data.Linq.DataContext.ExecuteMethodCall(Object instance, MethodInfo methodInfo, Object[] parameters)
   at PatchSystem.PatchSyncDBDataContext.sp_Patch_InsertPatchDetails_New(String patch_id, Nullable`1 incident_id, String customer_id, String version_no, String requestedUserEmail, String emails, String status, String selectedProjects, String framework_version, String svn_link, Nullable`1 server_id) in E:\Build_Team\WindowsFormsClient_Checkout\UserInterface\Modules\Patch\PatchSyncDB.designer.cs:line 356
   at PatchSystem.Data.InsertPatchDetails(String patchID, Int32 incidentID, String customerId, String esVersion, String requestedUserEmail, String email, String status, String selectedProjects, String frameworkVersion, String svnlink, Int32 serverId) in E:\Build_Team\WindowsFormsClient_Checkout\UserInterface\Modules\Patch\Data.cs:line 333




我收到了以上错误消息.我不知道我在哪里做错了.谁能帮帮我.

当控件来到这里时,我得到了错误.



Hi,
i got the above error message. i dont know where i did mistake. can anyone help me out.

When the control comes here, i got the error.

public int sp_Patch_InsertPatchDetails_New([Parameter(Name = "Patch_id", DbType = "VarChar(25)")] string patch_id, [Parameter(Name = "Incident_id", DbType = "Int")] System.Nullable<int> incident_id, [Parameter(Name = "customer_id", DbType = "VarChar(25)")] string customer_id, [Parameter(Name = "Version_no", DbType = "VarChar(100)")] string version_no, [Parameter(Name = "RequestedUserEmail", DbType = "VarChar(100)")] string requestedUserEmail, [Parameter(Name = "Emails", DbType = "VarChar(100)")] string emails, [Parameter(Name = "Status", DbType = "VarChar(50)")] string status, [Parameter(Name = "SelectedProjects", DbType = "VarChar(MAX)")] string selectedProjects, [Parameter(Name = "framework_version", DbType = "VarChar(MAX)")] string framework_version, [Parameter(Name = "svn_link", DbType = "VarChar(MAX)")] string svn_link, [Parameter(Name = "Server_Id", DbType = "Int")] System.Nullable<int> server_id)
        {
            IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), patch_id, incident_id, customer_id, version_no, requestedUserEmail, emails, status, selectedProjects, framework_version, svn_link, server_id);
            return ((int)(result.ReturnValue));
        }


谢谢.

推荐答案

此错误很明显,当您尝试将更多参数传递给存储过程时会出现此错误.
看看 [
This error is obvious, when you are trying to pass more parameter to a stored procedure then it expects.
Take a look at How to troubleshoot ‘Procedure or function has too many arguments specified’ [^] and resolve the error.

--Amit


1. 在为SP分配参数之前,请写以下行
1. before assigning parameters for SP write this line
cmd.Parameters.Clear()


2.
检查您是否通过了否.参数与存储过程中声明的相同
Haapy编码!
:)


2.
check you have passed no. of parameters same as declared in store procedure
Haapy Coding!
:)


这篇关于过程或函数sp_Patch_InsertPatchDetails_New指定的参数过多的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆