Re: Can someone explain why my code is not working
- From: "Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx>
- Date: Sat, 28 Apr 2007 08:39:26 -0400
jbonifacejr wrote:
Sorry if this angers anyone. I'm posting here and to the .NET group.
No anger here, It's just that you are not likely to get .Net assistance by
posting to a class ADO group Also, multiposting is definitely frowned upon.
See this thread:
http://groups.google.com/group/microsoft.public.inetserver.asp.db/browse_thread/thread/12b527322a3ad4df/9caef09e60b05718?hl=en#9caef09e60b05718
I
am unable to get a return value from a stored procedure in .NET using
the following Sproc and .NET code
In this case however, the answer is the same for both ADO.Net and classic
ADO: Add "SET NOCOUNT ON to the body of your procedure, as shown below.
The reason for this is that SQL Server returns informational "x rows
affected" messages (the ones you see when executing your procedure in Query
Analyzer) as resultsets. These resultsets need to be "consumed" by the
client BEFORE the ouput parameter value is sent. Setting NOCOUNT on
suppresses these messages.
I am a little curious why you are using classic ADO (ADODB) in your .Net
application vs. the native ADO.Net libraries. But you should discuss this in
the .Net group you posted to.
SET NOCOUNT ON
Here is the code in my stored proc.
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[sprocRetArtistSerial]
-- Add the parameters for the stored procedure here
@sArtist varchar(50),
@sRetArtist bigint OUTPUT
AS
BEGIN
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
.
- References:
- Can someone explain why my code is not working
- From: jbonifacejr
- Can someone explain why my code is not working
- Prev by Date: Can someone explain why my code is not working
- Next by Date: polling a database
- Previous by thread: Can someone explain why my code is not working
- Next by thread: polling a database
- Index(es):
Relevant Pages
|
|