Re: Stored Procedures

From: Anthony M. Davis (
Date: 05/21/04

  • Next message: Anders Altberg: "Re: Stored Procedures"
    Date: Fri, 21 May 2004 08:23:29 -0400

    Hi Egbert. I'm able to call my stored procedure okay, but I'm only getting a
    return_value back as opposed to a result set (my stored proc uses SELECT
    rather than UPDATE). Here's the code I included in my original post:

    OleDbCommand selectCMD = new OleDbCommand("GetSurcharges", conn);
      selectCMD.CommandType = CommandType.StoredProcedure;
      selectCMD.CommandTimeout = 30;

      OleDbDataAdapter da = new OleDbDataAdapter();
      da.SelectCommand = selectCMD;


      DataSet ds = new DataSet();

      DataView dv = new DataView(ds.Tables[0]);

      grdSurcharges.DataSource = dv;


    DataGrid Output:


    My test stored procedure is defined as:

    PROCEDURE GetSurcharges
        SELECT * FROM surcharge_application

        * note to readers: this proc will be more complex. i'm only using a
    simple SELECT for test purposes.. otherwise, i have no problem changing the
    OleDbCommand to "SELECT * FROM surcharge_application" and retrieving a
    result set

    Thanks for all your input,


    "Egbert Nierop (MVP for IIS)" <egbert_nierop@nospam.invalid> wrote in
    message news:%23D4JMByPEHA.3012@tk2msftngp13.phx.gbl...
    > "Anthony M. Davis" <> wrote in message
    > news:OGbG9suPEHA.1312@TK2MSFTNGP12.phx.gbl...
    > > Sorry, I guess I don't understand.. Isn't SQL Pass-Through for accessing
    > SQL
    > > Server data from FoxPro? Please remember my data is all in FoxPro dbf's
    > and
    > > the stored procedure I'm calling via VFPOLEDB is in the container
    > .DBC/.DCT.
    > >
    > > Again, all I'm trying to do is use OleDb to call a VFP-stored procedure
    > and
    > > obtain a result set. I'm now wondering if it is not possible to obtain
    > > result sets from VFP stored procedures via OleDb?? (i.e. need to upsize
    > > SQL Server if i want to make use of stored procedures in this manner?)
    > >
    > Hi,
    > In access, a stored procedure looks like
    > PARAMETERS name Text(50), id Long;
    > UPDATE tblName
    > SET lastname = [name]
    > WHERE name_id = [id]
    > You can access or declare this stuff using ADO (use a ADODB.Command object
    > with declared parameters and use the jet provider) as if it were a stored
    > proc. I suspect for 90% that something equal must be possible with

  • Next message: Anders Altberg: "Re: Stored Procedures"