PC Review


Reply
Thread Tools Rate Thread

Command Output Parameter not returnimg.

 
 
mark
Guest
Posts: n/a
 
      15th May 2004
Hi all,

Can anyone tell me why this code fails to return the output parameter from
the SP.



VB.Net Code ----------------



Dim adoCmd As New ADODB.Command

With adoCmd

.CommandText = "insCarType"

.CommandType = ADODB.CommandTypeEnum.adCmdStoredProc



.Parameters.Append(.CreateParameter("@CarType",
DataTypeEnum.adVarChar, ParameterDirectionEnum.adParamInput, 30, "Ford"))

.Parameters.Append(.CreateParameter("@intID",
DataTypeEnum.adInteger, ParameterDirectionEnum.adParamOutput, , 0))



.ActiveConnection = userConn

.Execute()



Return .Parameters(1).Value

End With



End VB.Net Code ------



SP Code -------

CREATE PROCEDURE [dbo].[insCarType]

( @CarType VARCHAR(30),
@intID INT = NULL OUTPUT )

AS

INSERT INTO CarTypes ( CarType ) VALUES (@CarType)

SET @intID = SCOPE_IDENTITY()

End SP Code -----------------

Many Thanks for any help you can give me


 
Reply With Quote
 
 
 
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      16th May 2004
* "mark" <(E-Mail Removed)> scripsit:
> Can anyone tell me why this code fails to return the output parameter from
> the SP.


Although your problem is related to VB.NET + ADO Classic, consider
posting to this groups if you don't get an answer here:

<URL:news://news.microsoft.com/microsoft.public.dotnet.framework.adonet>

Web interface:

<URL:http://msdn.microsoft.com/newsgroups/?dg=microsoft.public.dotnet.framework.adonet>

- or -

<URL:news://news.microsoft.com/microsoft.public.vb.database.ado>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
autorun.inf - shell\..\command with command line parameter doesn'twork kakii Windows XP Help 1 17th May 2007 08:54 PM
Command() Function to get command line parameter not working =?Utf-8?B?TWlrZSBCIGluIFZU?= Microsoft Access VBA Modules 3 10th Nov 2006 02:47 PM
Help in getting the output parameter from sp msnews.microsoft.com Microsoft ADO .NET 2 27th Apr 2005 02:37 PM
Difference Between Output Parameter And Return Parameter - SP =?Utf-8?B?U2FuamF5IEFncmF3YWw=?= Microsoft ADO .NET 4 30th Mar 2004 07:59 AM
DataReader with a return parameter and an OUTPUT parameter. Kevin Burton Microsoft ADO .NET 7 28th Nov 2003 06:14 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:56 PM.