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

Home Posts Topics Members FAQ

multiple recordset and dataset question

Hello:
I have a stored procedure that returns two record sets:
the first recordset returns two columns that have to do with internal error
handling processes
the second recordset returns a recodset containing multiple records
I would like to capture the second recordset into a datatable.......

Dim cn As New SqlConnection
cn.ConnectionString = GetConnectionString()
Dim cmd As New SqlCommand("Sproc_GenericGetDocTypes", cn)
cmd.CommandType = CommandType.StoredProcedure
Dim p1 As SqlParameter = cmd.Parameters.Add("@intAPPLICATIONSunid",
SqlDbType.Int, 4)
p1.Value = Applicationid
cn.Open()
Dim stuff As SqlDataReader
stuff = cmd.ExecuteReader()
While stuff.Read
GetDocumentTypes.RETURNED_ERROR = stuff("ERROR")
GetDocumentTypes.RETURNED_Answer = stuff("ANSWER")
End While

' go fetch the next recordset
stuff.NextResult()

Dim myDA As SqlDataAdapter = New SqlDataAdapter

Dim MyDataTable As New DataTable("DOCTYPES")

If GetDocumentTypes.RETURNED_ERROR = "000" Then

myDA.Fill(GetDocumentTypes.RETURNED_Dataset .............
<================== what should I put here ?

GetDocumentTypes.RETURNED_ERROR = TheError.Source
GetDocumentTypes.RETURNED_Answer = TheError.Message
myDA.Dispose()

End If

Thanks
Nov 21 '05 #1
3 1996
Support,

I see you not returning any recordset in your code question, what do you
mean?

Cor
Nov 21 '05 #2
Ok - I agree - how about: forward-only stream of rows instead of dataset...
via SqlDatareader.
I think I need to return a datatable not a dataset
I will explore that possibility..
Thanks

"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Support,

I see you not returning any recordset in your code question, what do you
mean?

Cor

Nov 21 '05 #3
Support,

You don't use the dataadapter at all, has that a reason.

(To try a stored procedure by the way is easier to set it in text first in
your program).
Using a stored procedure than is than only to change the command.text
property and removing the SP

Now it is impossible to see if you have created a joined resultset which
returns one table or a SP with two tables.

I hope this helps,

Cor

Nov 21 '05 #4

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

Similar topics

19
9288
by: Adam Short | last post by:
I am trying to write a routine that will connect a .NET server with a classic ASP server. I know the following code doesn't work! The data is being returned as a dataset, however ASP does not...
0
10222
by: Thaddeus | last post by:
//Author: //Thaddeus Jacobs, MCP //Kinematic Automation, Inc. //mailto:tjacobs@kinematic.com // //Description: //convert ADO .NET dataset to ADO 2.5 2.6 2.7 recordset and v/v //DataSet to...
2
3400
by: Marathoner | last post by:
I have read Bill Vaughn's paper on this subject and I have one stumbling block. Bill wrote his demo in VB.NET. He converts a DataTable to an XML file. In VB.NET, he dimmed a recordset and used...
9
2756
by: Graham | last post by:
I have been having some fun learning and using the new Controls and methods in .Net 2.0 which will make my life in the future easier and faster. Specifically the new databinding practises and...
5
25442
by: tony010409020622 | last post by:
I just spent 4 months taking a dotnet class where i learned very little. One of the things I did not learn is this: What are the dotnet equivilents of commands such as: Adodc1.Recordset.AddNew...
12
17614
by: Scott | last post by:
Front-end Access 2000 I have a stored procedure that has 2 parameters BusinessUnitID and Year. It returns multiple record sets (5 to be exact). I thought I could use a Pass through query but...
6
10802
by: James | last post by:
I am writing a web service for a classic ASP application. I need to consume an ADO recordset and then send it to another web service for processing. I found an MSDN ariticle telling how to do this...
4
1502
by: Joseph | last post by:
Hi all- I am a former VB6 programmer and new at C# and I have a question dealing with converting some code from VB6 to C#. The code is below and essentially, what it does is gets data from a SQL...
4
6121
by: =?Utf-8?B?TWFkaXNvbg==?= | last post by:
Hi all, Could I use the sqldatasource with stored-procedure to return multiple recordset? I did not want to have any sqldatasourec in the one page just to return the record back to...
0
7233
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
7135
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...
1
7067
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
7505
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...
0
5650
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,...
1
5060
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...
0
4729
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1570
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 ...
0
440
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.