473,414 Members | 1,630 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Problem retrieving data from Stored Procedure from SQL 2005

Hi,
I am creating a stored procedure which contains an output parameter.
Though the procedure is getting compiled properly I am not able to
execute it from within SQL Server Management Studio and also through
an aspx page. I keep getting empty output (not null)

The code:
Create procedure LoginUser
@cust_Password varbinary,
@cust_name varchar,
@cust_id int output
AS
BEGIN
SELECT @cust_id=Id from Customer where Name=@cust_name and
Password=@cust_Password;
END
How can I retreive the value @cust_id ?
Jun 27 '08 #1
2 1010
On May 27, 3:35 pm, Prasad <mahashabdepra...@gmail.comwrote:
Hi,
I am creating a stored procedure which contains an output parameter.
Though the procedure is getting compiled properly I am not able to
execute it from within SQL Server Management Studio and also through
an aspx page. I keep getting empty output (not null)

The code:

Create procedure LoginUser

@cust_Password varbinary,
@cust_name varchar,
@cust_id int output

AS

BEGIN

SELECT @cust_id=Id from Customer where Name=@cust_name and
Password=@cust_Password;

END

How can I retreive the value @cust_id ?
Hi

check out this thread, just check the last message

http://forums.asp.net/p/1208409/2362152.aspx

here is a good article that demonstrate Using Output Parameters

http://aspnet.4guysfromrolla.com/articles/062905-1.aspx
Best of luck

Munna
www.munna.shatkotha.com
www.munna.shatkotha.com/blog
www.shatkotha.com
Jun 27 '08 #2
Use
SELECT Id from Customer where Name=@cust_name and
Password=@cust_Password;

And call ExecuteScalar
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

30
by: dbuchanan | last post by:
ComboBox databindng Problem == How the ComboBox is setup and used: My comboBox is populated by a lookup table. The ValueMember is the lookup table's Id and the DisplayMember is the text from a...
3
by: Susanne Klemm | last post by:
Hello! I use a procedure to insert a new row into a table with an identity column. The procedure has an output parameter which gives me the inserted identity value. This worked well for a long...
4
by: red vertigo | last post by:
HI All, Can't quite get my head aorund this problem. My knowledge or more importantly my experience of using T-SQL is small and as a consequence my stored procedures are basic. My current...
12
by: Light | last post by:
Hi all, I posted this question in the sqlserver.newusers group but I am not getting any response there so I am going to try it on the fine folks here:). I inherited some legacy ASP codes in my...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.