Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / May 2008

Tip: Looking for answers? Try searching our database.

Problem retrieving data from Stored Procedure from SQL 2005

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Prasad - 27 May 2008 10:35 GMT
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 ?
SoftLion - 27 May 2008 11:48 GMT
Use
   SELECT  Id from Customer where Name=@cust_name and
Password=@cust_Password;

And call ExecuteScalar
Munna - 27 May 2008 11:49 GMT
> Hi,
> I am creating a stored procedure which contains an output parameter.
[quoted text clipped - 20 lines]
>
> 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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.