If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Procedure or function has too many arguments specified

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-11-06, 09:50
bono_8k bono_8k is offline
Registered User
 
Join Date: Oct 2006
Posts: 4
Procedure or function has too many arguments specified

i'm trying to insert into db sql 2000 through a stored procedure .. i got this error " Procedure or function newuser has too many arguments specified "

this is the procedure :



ALTER PROCEDURE newuser

(@username_1 [nvarchar](80),

@email_2 [nvarchar](50),

@password_3 [nvarchar](256),

@Country_ID_4 [int],

@city_id_5 [nvarchar](10),

@gender_6 [nvarchar](50),

@age_7 [int],

@fname_8 [nvarchar](50),

@lname_9 [nvarchar](50),

@birthdate_10 [datetime])

AS INSERT INTO [Brazers].[dbo].[users]

( [username],

[email],

[password],

[Country.ID],

[city.id],

[gender],

[age],

[fname],

[lname],

[birthdate])


VALUES

( @username_1,

@email_2,

@password_3,

@Country_ID_4,

@city_id_5,

@gender_6,

@age_7,

@fname_8,

@lname_9,

@birthdate_10)







& that 's the code in asp page :



Dim param As New SqlClient.SqlParameter

SqlConnection1.Open()

param.ParameterName = "@username_1"

param.Value = TextBox1.Text

param.Direction = ParameterDirection.Input

SqlCommand1.Parameters.Add(param)

SqlCommand1.ExecuteNonQuery()







plz .. waiting any solve for this problem immediately
Reply With Quote
  #2 (permalink)  
Old 10-11-06, 21:29
minhtruc minhtruc is offline
Registered User
 
Join Date: Oct 2006
Posts: 4
In your procedure have 10 arguments, the code in asp page also declare 10 parameters before run SqlCommand1.ExecuteNonQuery() command.
Reply With Quote
  #3 (permalink)  
Old 10-11-06, 23:23
jezemine jezemine is offline
another indirection layer
 
Join Date: May 2004
Location: Seattle
Posts: 1,312
also you need to do this:

SqlCommand1.CommandText = "newuser"

if you haven't done that further up in your code. it's not in the VB you pasted so I assume you forgot it.
__________________
elsasoft.org
Reply With Quote
  #4 (permalink)  
Old 10-11-06, 23:51
bono_8k bono_8k is offline
Registered User
 
Join Date: Oct 2006
Posts: 4
Quote:
Originally Posted by minhtruc
In your procedure have 10 arguments, the code in asp page also declare 10 parameters before run SqlCommand1.ExecuteNonQuery() command.

so wt is the wrong in that .. i can't understand wt u mean
Reply With Quote
  #5 (permalink)  
Old 10-12-06, 00:02
jezemine jezemine is offline
another indirection layer
 
Join Date: May 2004
Location: Seattle
Posts: 1,312
The point is that this sproc takes 10 args (none of which are optional) and you are only passing 1 arg.

You need to pass all 10.
__________________
elsasoft.org
Reply With Quote
  #6 (permalink)  
Old 10-12-06, 08:26
bono_8k bono_8k is offline
Registered User
 
Join Date: Oct 2006
Posts: 4
.......

for sure i pass all the 10 arguments befor excute non query
the error is still there & i got crazy of it ... do u think it it's error in db or somthing ..?
Reply With Quote
  #7 (permalink)  
Old 10-12-06, 09:12
wash wash is offline
Registered User
 
Join Date: Aug 2004
Location: Pune,India
Posts: 94
there of few things you need to check:
1. make sure you are psssing right S-Proc name to your command object.
2. You are passing right number of parameters to the stored proc.
3. You're passing these parameters in proper order.

do this and i think you will get the solution.

Hope this helps.
__________________
In GOD we believe. Everything else we Test!
Reply With Quote
  #8 (permalink)  
Old 10-12-06, 09:38
blindman blindman is offline
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
This does not appear to be an error in the procedure, but rather an error in your ASP code. Therefore I am moving this thread to the ASP forum where I hope somebody will be able to provide an answer.
__________________
If it's not practically useful, then it's practically useless.

blindman
www.chess.com: "sqlblindman"
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On