473,382 Members | 1,423 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Command Output Parameter not returnimg.

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
Nov 20 '05 #1
1 1485
* "mark" <re***@group.com> 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/>
Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: CoralineSage | last post by:
Hi there, I know very little about PHP, but I was just curious to know why exactly would some PHP code run fine from the command line but not from the browser? I'm just curious. I was working...
2
by: Stefan Berglund | last post by:
I was looking for a general consensus as to whether the ActiveConnection property of the command object should be set to Nothing or whether it's sufficient to set the command object itself to...
4
by: Cath B | last post by:
I am pretty sure I am getting a command timeout when execute a SQL procedure that has an output parameter. The code below is in an asp page that is called using RSGetASPObject. I want to be able...
1
by: Sandie Towers | last post by:
We use a number of similar databases and frequently create a new database using a backup restore of another similar database. We try to keep changes between databases in _Additional tables - like...
0
by: Rich Villanova | last post by:
I am trying to call a stored procedure using DB2 connect 7.2, first from the the command line then, from within SQL Server. However, whenever I call a stored procedure with an output parameter it...
7
by: David A. Osborn | last post by:
I am current writing a console program that takes two file paths as command line input. I get the command line input using the following code: parameter = Split(Command()) input = parameter(0)...
0
by: Ed | last post by:
All of a sudden my previously working code started throwing this error. from the SqlDatasource. I am using C# and Asp.net 2.0. Getting the following error: You have specified that your delete...
16
by: John Salerno | last post by:
Here's my new project: I want to write a little script that I can type at the terminal like this: $ scriptname package1 where scriptname is my module name and any subsequent arguments are the...
7
by: sonet | last post by:
in perl we can execute command and get result(command line stdout) by $a=`cmdline parameter`; print $a; in c system('cmdline parameter'); but i can not get the result (command line stdout).
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.