每次我運行我的更新函數時,我生成一個過程或函數有太多的參數指定的錯誤,我想我一直在尋找這個太久因爲我找不到根本原因。任何指導將不勝感激。過程或函數具有太多的參數在ASP.NET中使用VB.NEt指定
我的VB.NET代碼如下:
Public Function UpdateGenInfo_E1_01_02(ByVal pstrCon As String, _
ByVal appNo As String, _
ByVal revNo As String, _
ByVal prName As String, _
ByVal prAddr As String, _
ByVal prAddr2 As String, _
ByVal prCity As String, _
ByVal prState As String, _
ByVal prZip As String) As Integer
Try
'Create parameter
Dim lsqlParams(8) As SqlParameter
'fill parameter
lsqlParams(0) = New SqlParameter("@AppNo", appNo)
lsqlParams(1) = New SqlParameter("@RevNo", revNo)
lsqlParams(2) = New SqlParameter("@PrName", prName)
lsqlParams(3) = New SqlParameter("@PrAddr", prAddr)
lsqlParams(4) = New SqlParameter("@PrAddr2", prAddr)
lsqlParams(5) = New SqlParameter("@PrCity", prCity)
lsqlParams(6) = New SqlParameter("@PrState", prState)
lsqlParams(7) = New SqlParameter("@PrZip", prZip)
'Return dataset
Return SqlHelper.ExecuteNonQuery(pstrCon, CommandType.StoredProcedure, "up_UpdateGenInfo_E1_01_02", lsqlParams)
Catch ex As Exception
'Throw error
Throw ex
End Try
End Function
我的存儲過程如下:
USE [EpUpdates]
GO
/****** Object: StoredProcedure [dbo].[up_UpdateGenInfo_E1_01_02] Script Date: 04/26/2013 12:00:24 ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
ALTER PROCEDURE [dbo].[up_UpdateGenInfo_E1_01_02]
(
@AppNo varchar(10),
@RevNo varchar(4),
@PrName varchar(10),
@PrAddr varchar(50),
@PrAddr2 varchar(50),
@PrCity varchar(30),
@PrState varchar(2),
@PrZip varchar(10)
)
AS
UPDATE EpUpdates.dbo.GenInfo_E1_01_02
SET [email protected],
[email protected],
PrAddr2= @PrAddr2,
[email protected],
[email protected],
[email protected]
WHERE (AppNo = @AppNo)
AND (RevNo = @RevNo)
我認爲'(「@ PrAddr2」,PRADDR)'只是一個錯字,並這不可能是你真正的問題。 – 2013-04-28 04:50:29