473,508 Members | 2,369 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

stored procedure Q...

I am using ADO.Net in VB.net application. .Net Framework 1.1.

In a stored procedure I have multiple output parameters and multiple result
sets. How to code for this in ADO.Net?

I have used MyCommandObject.ExecuteNonQuery() when there were only output
parameters and no rows were returned from stored procedure.

I have used

Dim MyDataReader As SqlDataReader = MyCommandObject.ExecuteReader() when I
wanted to read one set of result set returned by stored procedure.

How to call a stored procedure when I have multiple output parameters and
multiple results sets?

Thanks,

Carl

Nov 19 '05 #1
2 2080
Once you get back SqlDataReader you can iterate over the results from the
first result set via Read() (don't forget that this is forward-only read-only).
If there are more result sets then call NextResult() to move to the next
one. This returns false if there are no other result sets. Once you've called
this method then you can iterate over the rows of the next resultset with
Read() just like the first results.

-Brock
DevelopMentor
http://staff.develop.com/ballen
I am using ADO.Net in VB.net application. .Net Framework 1.1.

In a stored procedure I have multiple output parameters and multiple
result sets. How to code for this in ADO.Net?

I have used MyCommandObject.ExecuteNonQuery() when there were only
output parameters and no rows were returned from stored procedure.

I have used

Dim MyDataReader As SqlDataReader = MyCommandObject.ExecuteReader()
when I wanted to read one set of result set returned by stored
procedure.

How to call a stored procedure when I have multiple output parameters
and multiple results sets?

Thanks,

Carl


Nov 19 '05 #2
and once you've processed all the results (NextResult() returns false), you
can access the output parameters.

-- bruce (sqlwork.com)

"Brock Allen" <ba****@NOSPAMdevelop.com> wrote in message
news:24**********************@msnews.microsoft.com ...
Once you get back SqlDataReader you can iterate over the results from the
first result set via Read() (don't forget that this is forward-only
read-only). If there are more result sets then call NextResult() to move
to the next one. This returns false if there are no other result sets.
Once you've called this method then you can iterate over the rows of the
next resultset with Read() just like the first results.

-Brock
DevelopMentor
http://staff.develop.com/ballen
I am using ADO.Net in VB.net application. .Net Framework 1.1.

In a stored procedure I have multiple output parameters and multiple
result sets. How to code for this in ADO.Net?

I have used MyCommandObject.ExecuteNonQuery() when there were only
output parameters and no rows were returned from stored procedure.

I have used

Dim MyDataReader As SqlDataReader = MyCommandObject.ExecuteReader()
when I wanted to read one set of result set returned by stored
procedure.

How to call a stored procedure when I have multiple output parameters
and multiple results sets?

Thanks,

Carl


Nov 19 '05 #3

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

Similar topics

3
22092
by: dinesh prasad | last post by:
I'm trying to use a servlet to process a form, then send that data to an SQL server stored procedure. I'm using the WebLogic 8 App. server. I am able to retrieve database information, so I know my...
0
6678
by: Nashat Wanly | last post by:
HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET View products that this article applies to. This article was previously published under Q310070 For a Microsoft...
3
2785
by: Rhino | last post by:
I've spent the last couple of hours trying to figure out how to debug a Java stored procedure and am just going in circles. The last straw came when I got "Cannot open input stream for default"...
4
3173
by: Rhino | last post by:
Is it possible for a Java Stored Procedure in DB2 V7.2 (Windows) to pass a Throwable back to the calling program as an OUT parameter? If yes, what datatype should I use when registering the...
8
7893
by: Thomasb | last post by:
With a background in MS SQL Server programming I'm used to temporary tables. Have just started to work with DB2 ver 7 on z/OS and stumbled into the concept of GLOBAL TEMPORARY TABLE. I have...
2
5437
by: Dino L. | last post by:
How can I run stored procedure (MSSQL) ?
0
2630
by: Amber | last post by:
Stored procedures are faster and more efficient than in-line SQL statements. In this article we will look at two SQL Server stored procedures; one using an input parameter and one not, and see how...
3
3460
by: kd | last post by:
Hi All, How to debug a stored procedure? Thanks, kd
7
3430
by: Dabbler | last post by:
I'm using an ObjectDataSource with a stored procedure and am getting the following error when trying to update (ExecuteNonQuery): System.Data.SqlClient.SqlException: Procedure or Function...
2
4080
by: jed | last post by:
I have created this example in sqlexpress ALTER PROCEDURE . @annualtax FLOAT AS BEGIN SELECT begin1,end1,deductedamount,pecentageextra FROM tax
0
7223
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,...
0
7115
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7377
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...
1
7036
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...
0
3191
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...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1547
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 ...
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
414
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...

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.