Re: Output Parameter Help
- From: "Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx>
- Date: Wed, 30 Aug 2006 13:49:48 -0400
Stephen Lynch wrote:
I am running a stored procedure via code but need help with the sytax
for the output parameter:
When I run this it works in SQL:
USE DataInput
GO
DECLARE @MyIdent int
EXEC a_spAppendNewContributionID
@CompanyId=1000,
@PayPeriod="8/12/2006",
@PlanYear=2006,
@ContributionDate="08/25/2006",
@ContributionID = @MyIdent OUTPUT
SELECT @MyIdent AS IdentityValue
SELECT * FROM MassPost
That doesn't help. What we really need to see is the CREATE PROCEDURE
statement so we can see the datatypes of the parameters. Also, we would
want to verify that your procedure contains a "SET NOCOUNT ON" statement
so that the informational "x records effected" statements will be
suppressed, preventing them from interfering with the retrieval of the
output parameter values.
Here's part of my code in asp. The @contributionID section is where
I am stuck, how do I declare the output parameter?
// Add Parameters to SPROC
OleDbParameter parameterCompanyId = new
Oops
There was no way for you to know it (except maybe by browsing through
some
of the previous questions in this newsgroup before posting yours -
always a
recommended practice) , but this is a classic ADO newsgroup. ADO.Net
bears
very little resemblance to classic ADO so, while you may be lucky enough
to
find a dotnet-knowledgeable person here who can answer your question,
you
can eliminate the luck factor by posting your question to a group where
those dotnet-knowledgeable people hang out. I suggest
microsoft.public.dotnet.framework.adonet.
If you have a web server, you might want to try out my code generator
page:
http://common.mvps.org/barrowsb/DotNet_sp_code_generator.zip
Even if you don't have a web server, you can probably migrate the code
to a windows form.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
.
- References:
- Output Parameter Help
- From: Stephen Lynch
- Output Parameter Help
- Prev by Date: Re: Calling stored procedure from ASP with ADO
- Next by Date: Need a recordcount in ADO recordset
- Previous by thread: Output Parameter Help
- Next by thread: Re: Calling stored procedure from ASP with ADO
- Index(es):
Relevant Pages
|
|