Re: Stored Procedures
From: Anthony M. Davis (davisam2_at_bellsouth.net)
Date: 05/21/04
- Previous message: Egbert Nierop \(MVP for IIS\): "Re: Stored Procedures"
- In reply to: Egbert Nierop \(MVP for IIS\): "Re: Stored Procedures"
- Next in thread: Egbert Nierop \(MVP for IIS\): "Re: Stored Procedures"
- Reply: Egbert Nierop \(MVP for IIS\): "Re: Stored Procedures"
- Messages sorted by: [ date ] [ thread ]
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;
conn.Open();
DataSet ds = new DataSet();
da.Fill(ds);
DataView dv = new DataView(ds.Tables[0]);
grdSurcharges.DataSource = dv;
grdSurcharges.DataBind();
conn.Close();
DataGrid Output:
return_value
True
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
ENDPROC
Thanks for all your input,
Tony
"Egbert Nierop (MVP for IIS)" <egbert_nierop@nospam.invalid> wrote in
message news:%23D4JMByPEHA.3012@tk2msftngp13.phx.gbl...
> "Anthony M. Davis" <tony@fnwarranty.com> 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
to
> > 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
Foxpro...
>
- Previous message: Egbert Nierop \(MVP for IIS\): "Re: Stored Procedures"
- In reply to: Egbert Nierop \(MVP for IIS\): "Re: Stored Procedures"
- Next in thread: Egbert Nierop \(MVP for IIS\): "Re: Stored Procedures"
- Reply: Egbert Nierop \(MVP for IIS\): "Re: Stored Procedures"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|