Hi again,
I'm trying to modify a form to trigger a stored procedure
upon submit. I have written up a stored procedure and tested it by running the
EXEC command from within SQL Management Studio. So it appears to be working.
However, after I modified the form to use the stored
procedure, I keep getting this error: Procedure or function SP_Contact_Create
has too many arguments specified."
I've been trying to figure this out all afternoon but I just
keep running into this error and cannot figure it out.
Thanks in advance for any assistance. My code snippets are
below.
-David
Stored Procedure
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[SP_Contact_Create]
@Name nvarchar(255),
@Phone nvarchar(255),
@Phone2 nvarchar(255),
@Address nvarchar(255),
@City nvarchar(255),
@State nvarchar(255),
@zip int,
@Country nvarchar(255),
@Department nvarchar(255),
@Subject nvarchar(255),
@Message nvarchar(MAX)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
INSERT INTO [dbo].[Contact_Form] (
[Name],
[Email],
[Phone],
[Phone2],
[Address],
[City],
[State],
[Zip],
[Country],
[Department],
[Subject],
[Message]
) VALUES (
@Name,
@Email,
@Phone,
@Phone2,
@Address,
@City,
@State,
@Zip,
@Country,
@Department,
@Subject,
@Message
)
END
GO
Xmod Submit Command
<SubmitCommand CommandText="SP_Contact_Create"
CommandType="StoredProcedure">
<Parameter Name="Name" />
<Parameter Name="Email" />
<Parameter Name="Phone" />
<Parameter Name="Phone2" />
<Parameter Name="Address" />
<Parameter Name="City" />
<Parameter Name="State" />
<Parameter Name="Zip" />
<Parameter Name="Country" />
<Parameter Name="Department" />
<Parameter Name="Subject" />
<Parameter Name="Message" />
<Parameter Name="ERROR"
Direction="Output" DataType="string" />
</SubmitCommand