Exforsys

Free Training

How to retrive values from Stored procedures in .net?

This is a discussion on How to retrive values from Stored procedures in .net? within the SQL Server 2005 Tutorials forums, part of the Articles and Tutorials category; Hello anyone, Can anyone tell me how to retrive the values from "Stored Procedures" using .net. I know oneway is ...

Go Back   Exforsys > Articles and Tutorials > SQL Server 2005 Tutorials

Exforsys.com


SQL Server 2005 Tutorials SQL Server 2005 Tutorials and Articles discussions

Reply

 

LinkBack Thread Tools Search this Thread
  #1 (permalink)  
Old 10-31-2006, 11:30 PM
svs_aditya's Avatar
Aditya
 
Join Date: Jul 2006
Location: India
Posts: 11
svs_aditya is on a distinguished road
Send a message via Yahoo to svs_aditya
Question How to retrive values from Stored procedures in .net?

Hello anyone,
Can anyone tell me how to retrive the values from "Stored Procedures" using .net.
I know oneway is using " Out parameters".
can anyone suggest the other?????
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-01-2006, 06:38 AM
Senior Member
 
Join Date: Mar 2005
Posts: 916
techguru is on a distinguished road
I would use sqldatareader.. so you can loop throug..
there is no need to define any out parameters in the procedure..

create procedure

in parameters

select * from table


retruns all the records you need as datareader which you can loop through...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 11-01-2006, 02:01 PM
svs_aditya's Avatar
Aditya
 
Join Date: Jul 2006
Location: India
Posts: 11
svs_aditya is on a distinguished road
Send a message via Yahoo to svs_aditya
Thanks

hai, thanks for giving one solution.

but my real problem is:
1.if we return any value in stored procedure using "return"(keyword) statement then how catch the return value in C#
2. simillar the above how fetch the returnerror message in C#
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 10-16-2007, 04:51 AM
DataBase Lover
 
Join Date: Oct 2007
Posts: 3
a.karrabi is on a distinguished road
Exclamation hi

if u use sqlcommand for executing stored procedure by wizard, return value stored in sqlcommand.parameter(0).value after sqlcommand.executeScalar().
if you write the code by yourself, you must add a parameter as RETURN type in add parameter list.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


Similar Threads

Thread Thread Starter Forum Replies Last Post
Problem with stored procedure NareshShroff SQL Server 2005 Tutorials 1 07-06-2007 04:16 AM
.NET Certification List lokeshm MicroSoft Certification 1 06-02-2006 06:21 AM
Microsoft .NET : An Introduction to the .NET FCL, Part 5 techguru Microsoft .NET Tutorials and Articles 0 08-29-2005 03:25 PM
Visual Basic : Security Concerns for Visual Basic .NET and Visual C# .NET Programmers techguru Visual Basic Tutorials 0 08-29-2005 01:27 AM
Free VB .NET Std Ed. and ASP.NET Develop. Book sanereddy Microsoft .NET Tutorials and Articles 0 10-05-2004 01:59 PM


All times are GMT -4. The time now is 12:22 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0
Copyright 2004 - 2009 Exforsys Inc. All rights reserved.