473,773 Members | 2,277 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can someone tell me where to post a code question for the following

Sorry if this angers anyone. I'm posting here and to the .NET group. I
am unable to get a return value from a stored procedure in .NET using
the following Sproc and .NET code
Here is the code in my stored proc.

set ANSI_NULLS ON
set QUOTED_IDENTIFI ER ON
GO
ALTER PROCEDURE [dbo].[sprocRetArtistS erial]
-- Add the parameters for the stored procedure here
@sArtist varchar(50),
@sRetArtist bigint OUTPUT
AS
BEGIN
SET @sRetArtist = (SELECT artSerial FROM tblArtists WHERE artName =
@sArtist)
END
I am calling it like this....

Dim iArtSer As Integer
Dim sProc As ADODB.Command
sProc = New ADODB.Command
sProc.CommandTe xt = "sprocRetArtist Serial"
sProc.CommandTy pe = ADODB.CommandTy peEnum.adCmdSto redProc
sProc.ActiveCon nection = oConn 'the connection is open and
global

sProc.Parameter s.Append(sProc. CreateParameter ("@sArtist",
ADODB.DataTypeE num.adVarChar,
ADODB.Parameter DirectionEnum.a dParamInput, 50, "Iron Maiden"))
sProc.Parameter s.Append(sProc. CreateParameter ("@sRetArtis t",
ADODB.DataTypeE num.adBigInt,
ADODB.Parameter DirectionEnum.a dParamOutput))

sProc.Execute()
iArtSer = sProc("@sRetArt ist).Value

Apr 28 '07 #1
2 1379
When you want a Microsoft newsgroup than you can think about,
microsoft.publi c.data.ado.

Be aware that your code is not the modernst, you can also look for an older
book from Bill Vaughn (not the newer ones)

Cor
"jbonifacej r" <jb*********@ho tmail.comschree f in bericht
news:11******** **************@ o5g2000hsb.goog legroups.com...
Sorry if this angers anyone. I'm posting here and to the .NET group. I
am unable to get a return value from a stored procedure in .NET using
the following Sproc and .NET code
Here is the code in my stored proc.

set ANSI_NULLS ON
set QUOTED_IDENTIFI ER ON
GO
ALTER PROCEDURE [dbo].[sprocRetArtistS erial]
-- Add the parameters for the stored procedure here
@sArtist varchar(50),
@sRetArtist bigint OUTPUT
AS
BEGIN
SET @sRetArtist = (SELECT artSerial FROM tblArtists WHERE artName =
@sArtist)
END
I am calling it like this....

Dim iArtSer As Integer
Dim sProc As ADODB.Command
sProc = New ADODB.Command
sProc.CommandTe xt = "sprocRetArtist Serial"
sProc.CommandTy pe = ADODB.CommandTy peEnum.adCmdSto redProc
sProc.ActiveCon nection = oConn 'the connection is open and
global

sProc.Parameter s.Append(sProc. CreateParameter ("@sArtist",
ADODB.DataTypeE num.adVarChar,
ADODB.Parameter DirectionEnum.a dParamInput, 50, "Iron Maiden"))
sProc.Parameter s.Append(sProc. CreateParameter ("@sRetArtis t",
ADODB.DataTypeE num.adBigInt,
ADODB.Parameter DirectionEnum.a dParamOutput))

sProc.Execute()
iArtSer = sProc("@sRetArt ist).Value

Apr 28 '07 #2
Why are you using ADODB in .Net instead of ADO.Net?

Robin S.
----------------------------
"jbonifacej r" <jb*********@ho tmail.comwrote in message
news:11******** **************@ o5g2000hsb.goog legroups.com...
Sorry if this angers anyone. I'm posting here and to the .NET group. I
am unable to get a return value from a stored procedure in .NET using
the following Sproc and .NET code
Here is the code in my stored proc.

set ANSI_NULLS ON
set QUOTED_IDENTIFI ER ON
GO
ALTER PROCEDURE [dbo].[sprocRetArtistS erial]
-- Add the parameters for the stored procedure here
@sArtist varchar(50),
@sRetArtist bigint OUTPUT
AS
BEGIN
SET @sRetArtist = (SELECT artSerial FROM tblArtists WHERE artName =
@sArtist)
END
I am calling it like this....

Dim iArtSer As Integer
Dim sProc As ADODB.Command
sProc = New ADODB.Command
sProc.CommandTe xt = "sprocRetArtist Serial"
sProc.CommandTy pe = ADODB.CommandTy peEnum.adCmdSto redProc
sProc.ActiveCon nection = oConn 'the connection is open and
global

sProc.Parameter s.Append(sProc. CreateParameter ("@sArtist",
ADODB.DataTypeE num.adVarChar,
ADODB.Parameter DirectionEnum.a dParamInput, 50, "Iron Maiden"))
sProc.Parameter s.Append(sProc. CreateParameter ("@sRetArtis t",
ADODB.DataTypeE num.adBigInt,
ADODB.Parameter DirectionEnum.a dParamOutput))

sProc.Execute()
iArtSer = sProc("@sRetArt ist).Value

May 1 '07 #3

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

Similar topics

4
1797
by: Fang | last post by:
Hi, I'm new to PHP. I followed an example on the book and wanted to pass a variable from one html page to a php page, but it always tells me the passed variable is undefined. I've checked the syntax over and over again, but I couldn't find the problem. I also tried to change POST to SUBMIT and noticed the value of the variable can be passed. Why can't the target php catch it??? The code is as following, can any one please kindly help me...
4
3578
by: Aaron Ackerman | last post by:
I am using typed datasets in an N-Tier Windows app using VB.NET. I know this posting cannot be fully explained in a single post that is why I am asking for someone to point me to a real world tutorial (in vb.net) that can show me how to use a bound Datagrid to it's fullest potential. I need to utilize the bound Datagrid in two modes. One were a bound Datagrid can be in edited directly utilizing bound combos and textbox right on the grid,...
10
2082
by: Andreas Sheriff | last post by:
Please evaluate the following snippet: int a=5; int b; b = a++ + a; Edit1->Text = b; a = 5; b = a++ + ++a; Edit2->Text = b;
21
3511
by: MLH | last post by:
A97 procedure to open http://www.arch.com/message/ enter an 800 number, press "Continue", enter a text msg string from a memo field and press "Send" This is a calendaring and appointment A97 database for an attorney's office. I'm sure it must be do-able. I know better than to mention the term "S__dK__ys" in conjunction with this topic. I've read enough in here to know that is extremely unreliable. Am sorry even that I have to use IE...
2
2058
by: Henry | last post by:
I am trying to write an application that allows me to dynamically load selected Crystal Report files, read the parameters from the report file, give the user a chance to enter relevant data in a user friendly manner and then run the report in a report viewer. I can find bits and pieces of the instructions for doing this, but I don't seem to be able to put it all together. For now I have some code that will show a file Open dialog and...
10
2185
by: Extremest | last post by:
I know there are ways to make this a lot faster. Any newsreader does this in seconds. I don't know how they do it and I am very new to c#. If anyone knows a faster way please let me know. All I am doing is quering the db for all the headers for a certain group and then going through them to find all the parts of each post. I only want ones that are complete. Meaning all segments for that one file posted are there. using System;
7
1782
by: rn5a | last post by:
This is the second time I am asking this question in this newsgroup since I haven't got a solution or response from anyone in my previous post & I need to resolve this issue desperately. Sorry for the double post but I just didn't have any other option other than re-posting the same question in this newsgroup. Consider the following code in a VB class file: Namespace LoginUserFetchDB Public Class ZForZebra : Inherits SoapHeader
1
1573
by: mela | last post by:
it seems quite stupid but i am building up my web site and i am stocked with this problem: i download this photoslider script and wanted to have two on the same page but they are interfering one each other.. now: i read that to avoid this i should change the names of the variables and those of the functions on the second script , but i do not know where to start from! can anybody explain me in a simple way (i do not know java at all!) what i...
0
9621
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10039
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9914
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8937
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4012
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3610
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2852
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.