How to return a DataSet from a SQL Server Stored Procedure in C#.Net

Discussion in 'Software for Windows' started by Gunslinger08, Dec 19, 2005.

  1. Gunslinger08

    Gunslinger08 Lifer

    Joined:
    Nov 18, 2001
    Messages:
    13,237
    Likes Received:
    0
    I need to pass a parameter to the stored procedure as well.
     
  2. Stuxnet

    Stuxnet Diamond Member

    Joined:
    Jun 16, 2005
    Messages:
    8,405
    Likes Received:
    0
    Download the application block "SqlHelper" and use "ExecuteDataSet(...)".
     
  3. Spydermag68

    Spydermag68 Platinum Member

    Joined:
    Apr 5, 2002
    Messages:
    2,469
    Likes Received:
    17
    Chapter 19 from this website has the code.

    Pro C# 2005
     
  4. DaShen

    DaShen Lifer

    Joined:
    Dec 1, 2000
    Messages:
    10,712
    Likes Received:
    0
    Establish a (SQL, ADO, OLEDB) connection, Set a (SQL, ADO, OLEDB) Command using the stored procedure, Set & Instantiate a DataAdapter, Use the Command to set the Data Adapter, Fill the DataSet using the DataAdapter and whatever table or field you want, Use the DataSet in C#.

    I think that is it. You may want to look it up though.
     
Loading...