Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
ALTER PROCEDURE dbo.update_data
	@user_id numeric(18,0),
	@name1 varchar(50),
	@address varchar(50),
	@mob varchar(50),
	@city varchar(50),
	@emailid varchar(50),
	@username varchar(50),
	@password varchar(50),
	@log_id numeric(18,0)
AS
 

BEGIN    
  Begin Transaction
 

	begin
 

	UPDATE    [user.]
	SET name1 = @name1,
		address = @address,
	    mob = @mob,
	    city = @city,
	    emailid = @emailid
	    
	    
		WHERE (user_id = @user_id)
	
SELECT     log_id
FROM         [user.]
WHERE     (user_id = @user_id)
	end
 

	begin
	UPDATE    login
	SET              username = @username, password = @password
	WHERE     (log_id = @log_id)
	end
	Commit  transaction
end
 
	
 
	
 

 
i have two table.1)profile :
name
address
city
mob
emailid
log_id
 
2)login:
log_id
username
password
 
i have to update data in profile and then select log_id from that updated data.
using this log_id i have to update login table.
for this i have write store procedure as given.but error comming like :storeprocedure expect parameter @log_id
 
what is problem in my code?
Posted 26-Jan-13 22:44pm
Edited 26-Jan-13 22:57pm
v2
Comments
Zoltán Zörgő at 27-Jan-13 4:52am
   
Your procedure code is partial, please improve your question by posting the whole procedure code.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

"storeprocedure expect parameter @log_id"
 
Is a pretty clear error message.
When you call the SP, you are not providing all the parameters. Probably, you have miss-spelled "@log_id" as "@logid" or "@log_in" or forgotten it completely. You don't show the code you use to call the procedure, so I can't be any more specific.
  Permalink  
Comments
Member 9511889 at 27-Jan-13 5:27am
   
i have solve this error.now i have not any error,but update will done in profile table only .uasearname and password are not updated in login table.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 329
1 OriginalGriff 275
2 Richard MacCutchan 220
3 Jared Sanow 145
4 Vinay Mistry 143
0 Sergey Alexandrovich Kryukov 5,939
1 OriginalGriff 4,885
2 CPallini 2,473
3 Abhinav S 1,507
4 Richard MacCutchan 1,437


Advertise | Privacy | Mobile
Web01 | 2.8.140814.1 | Last Updated 27 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100