473,785 Members | 2,249 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Read ouput parameters from stored procedure.

3 New Member
I am trying to find the value from some output parameters from a stored procedure. I have tried several different methods but somehow cannot get it to work. here is my source code:

dim dr as ODBCDataReader
Dim comm as New ODBCCommand("{c all jgrant_awcconne ct..edit_equipm ent (?, ?, ?, ?, ?, ?)}", conn)

comm.parameters .add("@equipmen tId", System.Data.Sql DbType.bigint)
comm.parameters ("@equipmentId" ).Direction = ParameterDirect ion.Input
comm.parameters ("@equipmentId" ).value = CInt(session("E quipmentId"))
comm.parameters .add("@Short", System.Data.Sql DbType.Nvarchar )
comm.parameters ("@Short").s ize = 20
comm.parameters ("@Short").Dire ction = ParameterDirect ion.Output
comm.parameters .add("@Long", System.Data.Sql DbType.Nvarchar )
comm.parameters ("@Long").si ze = 50
comm.parameters ("@Long").Direc tion = ParameterDirect ion.Output
comm.parameters .add("@Owned", System.Data.Sql DbType.Nvarchar )
comm.parameters ("@Owned").s ize = 3
comm.parameters ("@Owned").Dire ction = ParameterDirect ion.Output
comm.parameters .add("@Job_Pric e", System.Data.Sql DbType.money)
comm.parameters ("@Job_Price"). Direction = ParameterDirect ion.Output
comm.parameters .add("@Job_Cost ", System.Data.Sql DbType.money)
comm.parameters ("@Long").Direc tion = ParameterDirect ion.Output
conn.open()

dr = comm.executerea der()
dr.close
conn.close()
txtShort.text = comm.parameters ("@Owned").valu e
txtLong.text = comm.parameters ("@Owned").valu e

This code doesnt generate any errors but also does not display the right value. Anybody have any thoughts?
Aug 26 '07 #1
2 1737
jigsmshah
14 New Member
try to use 'ParameterDirec tion.ReturnValu e' rather than output
what ever value you return from stored procedure will be available in this returnValue in the front end
For better ubderstanding please refer the following link
http://www.mcse.ms/message1454145. html

Regards
Jignesh
Aug 27 '07 #2
Jared Grant
3 New Member
I am trying to read the parameters not the return value. But good tip, I will use that in the future.
Aug 27 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
5443
by: Aaron | last post by:
The following code works fine when previewing a Crystal report using ASP, EXCEPT when it gets to a report using a SubReport and its associated parameters. The whole report just comes up blank with this error message: "The Error Message was: Error detected by database DLL.from: Crystal Reports ActiveX Designer". What am I doing wrong in the SubReport section below and how do I properly pass in sproc params to the subreport? Thanks. ...
8
9873
by: Mark Flippin | last post by:
This is for a reporting problem using: Access 2000 SQL Server 2000 Both at SP3 I've a stored procedure in SQL Server 2000 which builds a result set from a disparate set of tables, utilizing a temp table. The procedure takes two parameters to specify the criteria on selecting the table information for inclusion in the result set, builds the temp table,
1
962
by: Johnny | last post by:
I have a stored procedure that takes three input parameters and returns a single record result set. The stored procedure is declare as follows: p_getTaxAmount (@ZipCodeDtlId uniqueidentifier, @CategoryID uniqueidentifier, @SalesAmount decimal(17,8)) I have a windows form where the user enters the zip code, category, and sales amount. I need to know how to capture the value in the sales amount text box and send it as a parameter to...
4
3001
by: Mike Dinnis | last post by:
Hi, I've been working through a number of turorials to try to learn more about retrieving data from a SQL database. I think i've mastered techniques where i create a sql string in the page and pass it to the Db and retrieveing data from a stored procedure, but I can't get the hang of parameters. I have a method where I can get the parameters passed to the sp but it doesn't want to return any results. Here's a copy of my code:
2
1866
by: Rob Meade | last post by:
Hi all, I was wondering if anyone could give me a small example of running a stored procedure with both output and input parameters via asp.net (vb). I have tried a couple of things, one of which worked, but now I'm trying to change my code so that its the 'proper' way of doing things.. My stored proc expects the following:
10
2351
by: Adis | last post by:
Asp.Net Visual Studio 2003 SQL Server. Hi, Obtaining Data Based Upon Multiple Selections From a ListBox... I have database in Sqlserver and ListBox (Multiple Selection Mode) in my Visual Studio Webform. I wish obtain various records from My_Store_Procedure
5
2361
by: ric_deez | last post by:
Hi there, I would like to create a simple search form to allow users to search for a job number based on a number of parameters. I think I understand how to use parameteres associated with Stored Procedures with a data reader to add various parameters. However, if I have a stored procedure such as CREATE usp_SelectfromJobNumbers (@par1 datatype, @par2 datatype, @par3 datatype)
3
2961
by: =?Utf-8?B?ZGF2aWQ=?= | last post by:
I try to follow Steve's paper to build a database, and store a small text file into SQL Server database and retrieve it later. Only difference between my table and Steve's table is that I use NTEXT datatype for the file instead of using IMAGE datatype. I can not use SqlDataReader to read the data. I need your help, Thanks. -David (1) I have a table TestFile for testing: ID int FileName navrchar(255)
0
3811
by: pbaillard | last post by:
Here a sample to call a stored procedure with an Oracle Database. odc.Connection = m_cDb ' use an open connection to your database odc.CommandType = CommandType.StoredProcedure odc.CommandText = "pkg_func.GetReqStatus" ' just set the name of the function, don't used syntax like {? = call pkg_func.GetReqStatus(?,?,?)} ' the return parameter odp = New OleDbParameter("result", OleDbType.VarChar)
0
10350
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10157
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...
0
9957
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...
1
7505
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5386
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5518
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4055
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
3658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2887
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.