Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Procedure or function has too many arguments specified

Reply
Thread Tools

Procedure or function has too many arguments specified

 
 
David Lozzi
Guest
Posts: n/a
 
      03-02-2007
Howdy,

ASP.Net 2.0 using VB on SQL 2005

This is a two fold issue.

I have a DetailsView control which users can insert or edit items. Editing
works great. Insert works great however I need to display the form once the
user has entered the information and clicked Add.

1) Trying to get the record ID of the inserted record. ReturnValue doesnt
appear to work properly so i'm using an OUTPUT value instead. I get Null
reference errors when working with RETURN SCOPE_IDENTITY()

2) Getting "Procedure or function cp_InsertPublication has too many
arguments specified" error when trying to insert. See code below. All
parameters match up fine.


Thanks!!

David Lozzi


<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:SMALLConnectionString %>"
DeleteCommand="DELETE FROM [tblPublications] WHERE [ID] = @ID"
InsertCommand="cp_InsertPublication"
InsertCommandType="StoredProcedure"
SelectCommand="SELECT * FROM [tblPublications] WHERE ([ID] =
@ID)"
UpdateCommand="UPDATE [tblPublications] SET [strName] =
@strName, [dtDate] = @dtDate, [strPDF] = @strPDF, [intPages] = @intPages,
[strWrittenBy] = @strWrittenBy, [intType] = @intType, [dtModified] = {fn
Now()} WHERE [ID] = @ID">
<DeleteParameters>
<asparameter Name="ID" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asparameter Name="strName" Type="String" />
<asparameter Name="dtDate" Type="DateTime" />
<asparameter Name="intPages" Type="Int32" />
<asparameter Name="strWrittenBy" Type="String" />
<asparameter Name="dtAdded" Type="DateTime" />
<asparameter Name="dtModified" Type="DateTime" />
<asparameter Name="intType" Type="int32" />
<asp:ControlParameter Name="strPDF"
ControlID="dvDetails$Label5" PropertyName="Text" />
<asparameter Name="ID" Type="Int32" />
</UpdateParameters>
<SelectParameters>
<asp:QueryStringParameter Name="ID" QueryStringField="PID"
Type="Int32" />
</SelectParameters>
<InsertParameters>
<asparameter Name="strName" Type="String" />
<asparameter Name="dtDate" Type="DateTime" />
<asparameter Name="intPages" Type="Int32" />
<asparameter Name="strWrittenBy" Type="String" />
<asparameter Name="intType" Type="int32" />
<asparameter Name="returnValue" Type="int32"
Direction="output" />
</InsertParameters>
</asp:SqlDataSource>



set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[cp_InsertPublication]
@strName as varchar(500),
@dtDate as datetime,
@intPages as int,
@strWrittenBy as varchar(50),
@intType as int,
@returnValue as int OUTPUT
AS

INSERT INTO [tblPublications]
([strName], [dtDate], [intPages], [strWrittenBy], [intType], [dtAdded],
[dtModified])
VALUES
(@strName, @dtDate, @intPages, @strWrittenBy, @intType, {fn Now()}, {fn
Now()})

SET @returnValue = SCOPE_IDENTITY()

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Procedure or function Authorize_Member has too many arguments specified Seth Williams ASP .Net 1 09-16-2008 02:21 PM
Procedure or function has too many arguments specified Mike ASP .Net 3 10-28-2006 07:55 PM
Procedure or function RecordTxn has too many arguments specified c676228 ASP General 2 09-14-2006 04:14 PM
'Procedure or function <stored procedure name> has too many arguments specified',,,ARGH! Mike P ASP .Net 0 06-19-2006 01:19 PM
Procedure or function has too many arguments specified John Smith ASP .Net Web Controls 0 06-29-2005 03:45 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57