How get data from a storedprocedure?

Posted on 2007-09-28
Last Modified: 2013-12-17
My Stored procedure is;
ALTER PROCEDURE [dbo].[MyStoredProcedure]
    @xxx nvarchar(40),
    @yyy        nvarchar(20)
    IF (EXISTS( SELECT * FROM dbo.MyTable WHERE  xxx= @xxxAND yyy= @yyy))
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?
Question by:kosturdur
    LVL 14

    Assisted Solution

    if it is going to return only one value like true / false / single name etc., you can use

    executeScalar("spname 'value1','value2')
    use commandtext and write to a datatable / data set
    LVL 142

    Accepted Solution

    I think the following tutorial should explain it all:

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    In my previous article ( we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
    More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now