473,799 Members | 3,866 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.ConnectionSt ring = GetConnectionSt ring()
Dim cmd As New SqlCommand("Spr oc_GenericGetDo cTypes", cn)
cmd.CommandType = CommandType.Sto redProcedure
Dim p1 As SqlParameter = cmd.Parameters. Add("@intAPPLIC ATIONSunid",
SqlDbType.Int, 4)
p1.Value = Applicationid
cn.Open()
Dim stuff As SqlDataReader
stuff = cmd.ExecuteRead er()
While stuff.Read
GetDocumentType s.RETURNED_ERRO R = stuff("ERROR")
GetDocumentType s.RETURNED_Answ er = stuff("ANSWER")
End While

' go fetch the next recordset
stuff.NextResul t()

Dim myDA As SqlDataAdapter = New SqlDataAdapter

Dim MyDataTable As New DataTable("DOCT YPES")

If GetDocumentType s.RETURNED_ERRO R = "000" Then

myDA.Fill(GetDo cumentTypes.RET URNED_Dataset .............
<============== ==== what should I put here ?

GetDocumentType s.RETURNED_ERRO R = TheError.Source
GetDocumentType s.RETURNED_Answ er = TheError.Messag e
myDA.Dispose()

End If

Thanks
Nov 21 '05 #1
3 2009
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******** ********@TK2MSF TNGP12.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
9332
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 recognise datasets and requires a recordset. Can the datatypes be converted? At the Classic ASP end or .NET end? Can SOAP toolkit provide the conversion, can any toolkit provide a conversion? ...
0
10276
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 recordset conversion. //Get RecordSet from Dataset //ds2rs DataSet2RecordSet
2
3425
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 this syntax: rs.Open(sPathToXMLfile) When incorporating his code in my C# app, the ADODB.Recordset Open method takes 5 arguments, all required. VB.NET arguments are, I assume, optional since they are in square brackets.
9
2779
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 wizards. But, I have found that trying to do something "outside the norm" adds a rather large level of complexity and/or data replication. Background I have been commissioned to create a web-based application for a client. It has a formsaunthentication...
5
25464
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 Adodc1.Recordset.Update Adodc1.Recordset.MoveFirst Adodc1.Recordset.MoveNext Adodc1.Recordset.Delete
12
17673
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 that only returns the first record set. I thought I could use ADO but that does not seem to work. I get an Error
6
10835
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 (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconfillingdatasetwithadorecordset.asp), one big problem - it says to import ADOComponent.dll and msado15.dll. I found msado15.dll but I can't find ADOComponenet.dll,...
4
1510
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 Server database and parses some of the data and puts the parsed data into a text field. I omitted a some of the code and left the data parsing part of it, which is what my question is about. Exactly what the code below does is gets data from SQL...
4
6137
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 dropdownlists. In my stored procedure will have 2 select statement. If it can be done how I refer to each dropdownlist to correct recordset. Please advise. Thanks.
0
9687
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...
1
10237
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
10029
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
7567
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
5467
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
5588
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4144
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
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
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.