473,320 Members | 2,202 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,320 software developers and data experts.

No output parameter.......

I am calling a stored procedure which returns the result set and output
parameter.

My code look like this..

Dim MyReader As SqlDataReader = myCmd.ExecuteReader()

If Not Convert.IsDBNull(myCmd.Parameters("@TotalCount").V alue) Then

iTARCount = CType(myCmd.Parameters("@TotalCount ").Value, String)

End If

If I block the result set in the stored procedure, I can read the output
parameter. Otherwise output parameter is always zero.

I am using .Net Framework 1.1 and SQL2K.

Please advice.

Vicky
Nov 19 '05 #1
1 1046
output parameters are not available until you have processed all rows and
results sets from the reader. so you need to read the rows first.
Dim MyReader As SqlDataReader = myCmd.ExecuteReader()

do
do while MyReader.Read()
'* process rows
loop
loop while MyReader.NextResult()

If Not Convert.IsDBNull(myCmd.Parameters("@TotalCount").V alue) Then
iTARCount = CType(myCmd.Parameters("@TotalCount ").Value, String)
End If

"Vickey Nelson" <Vi********@hotmail.com> wrote in message
news:uu*************@TK2MSFTNGP15.phx.gbl...
I am calling a stored procedure which returns the result set and output
parameter.

My code look like this..

Dim MyReader As SqlDataReader = myCmd.ExecuteReader()

If Not Convert.IsDBNull(myCmd.Parameters("@TotalCount").V alue) Then

iTARCount = CType(myCmd.Parameters("@TotalCount ").Value, String)

End If

If I block the result set in the stored procedure, I can read the output
parameter. Otherwise output parameter is always zero.

I am using .Net Framework 1.1 and SQL2K.

Please advice.

Vicky

Nov 19 '05 #2

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

Similar topics

7
by: LineVoltageHalogen | last post by:
Greetings All, I have a very large query that uses dynamic sql. The sql is very large and it requires it to be broken into three components to avoid the nvarchar(4000) issue: SET @v_SqlString(...
0
by: rockdale | last post by:
Hi, All How to get the output parameter's value when you use the SQLHelper (Microsoft Data Access Block)? When I try to access my ourput parm I got the following error. ...
8
by: Alec MacLean | last post by:
Hi, I'm using the DAAB Ent Lib (Jan 2006) for .NET 2.0, with VS 2005 Pro. My project is a Web app project (using the WAP add in). Background: I'm creating a survey system for our company, for...
7
by: ashtek | last post by:
Hi, I have a generic function that executes a stored procedure & returns a data table. Code: === public static DataTable ExecuteStoredProcedure(string strProc,SqlParameter paramArray) {...
1
by: John Bailo | last post by:
This is a my solution to getting an Output parameter from a SqlDataSource. I have seen a few scant articles but none of them take it all the way to a solution. Hopefully this will help some...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.