• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 163
  • Last Modified:

How get data from a storedprocedure?

My Stored procedure is;
ALTER PROCEDURE [dbo].[MyStoredProcedure]
    @xxx nvarchar(40),
    @yyy        nvarchar(20)
AS
BEGIN
    IF (EXISTS( SELECT * FROM dbo.MyTable WHERE  xxx= @xxxAND yyy= @yyy))
        RETURN(1)
    ELSE
        RETURN(0)
END
I want to get the return value(0/1 or true/false) of the MyStoredProcedure at run time with C# by using a SqlDataSource. How can I give the paramerters and how I can get the value?
0
kosturdur
Asked:
kosturdur
2 Solutions
 
Jai STech ArchCommented:
if it is going to return only one value like true / false / single name etc., you can use

executeScalar("spname 'value1','value2')
else
use commandtext and write to a datatable / data set
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
I think the following tutorial should explain it all:
http://blogs.msdn.com/smartclientdata/archive/2006/08/09/693113.aspx
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now