|
 |
ado_dotnet thread: RE: Stored Proc REturning a dataset???
Message #1 by "Vittal_setty" <Vittal_setty@i...> on Sun, 22 Dec 2002 03:31:59 +0530
|
|
Hi All,
I am currently with ADO.NET and SQL server2000.
Is it possible for a stored proc to return a dataset.
A dataset is basically an XML and a stored proc can return data as XML
RAW or XML Explicit. So I guess this should be possible.
I tried using the adapter but then with this I can populate only one
table of the dataset at a time. How can I make my stored proc return
multiple sets of tables which would fit into my dataset??
Can anyone throw some more light on this?
Would highly appreciate if any sample code/ links are available.
Thanks for your time
Vittal
Message #2 by "Brian Smith" <bsmith@l...> on Mon, 23 Dec 2002 09:13:00 -0000
|
|
If your stored proc contains more than one SELECT statement, then you
can fill a DataSet in one go - each SELECT populating a different table
(Table, Table1, Table2 etc). You do not need to use FOR XML to achieve
this. If you do use FOR XML, then you'll have to use the XmlReader in
something like this:
myDataSet.ReadXml(mySqlCommand.ExecuteXmlReader(),
XmlReadMode.Fragment)
This link might help:
http://samples.gotdotnet.com/quickstart/howto/doc/adoplus/ADOPlusOvervie
w.aspx
brian
-----Original Message-----
From: Vittal_setty [mailto:Vittal_setty@i...]
Sent: Sat, 21 Dec 2002 22:02
To: ADO.NET
Subject: [ado_dotnet] RE: Stored Proc REturning a dataset???
Hi All,
I am currently with ADO.NET and SQL server2000.
Is it possible for a stored proc to return a dataset.
A dataset is basically an XML and a stored proc can return data as XML
RAW or XML Explicit. So I guess this should be possible.
I tried using the adapter but then with this I can populate only one
table of the dataset at a time. How can I make my stored proc return
multiple sets of tables which would fit into my dataset??
Can anyone throw some more light on this?
Would highly appreciate if any sample code/ links are available.
Thanks for your time
Vittal
===
Fast Track ADO.NET with C# is a concise introduction to the concepts,
techniques, and libraries that you will need in order to start using
ADO.NET in your applications. The book covers DataSets and Typed
DataSets, accessing data using DataReaders and DataAdaptors, the close
relationship between ADO.NET and XML, how and where to use ADO.NET in
your enterprise applications, and how to use Web Services and ADO.NET to
easily pass data between applications.
http://www.wrox.com/books/1861007604.htm
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.431 / Virus Database: 242 - Release Date: 17/12/2002
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.431 / Virus Database: 242 - Release Date: 17/12/2002
|
|
 |