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

XML > Dataset. Please, I need help. Thank You.

Hello,

I have a XML file that includes the node <item>:
....
<title>...</title>
<url>...</url>
<item>
<title>title 01</title>
<description>description 01</description>
</item>
<item>
<title>title 02</title>
<description>description 02</description>
</item>
....
How to get all title and description values into a dataset or
datareader?

Thank You,
Miguel

Nov 19 '05 #1
4 1292
Shapper wrote:
Hello,

I have a XML file that includes the node <item>:
...
<title>...</title>
<url>...</url>
<item>
<title>title 01</title>
<description>description 01</description>
</item>
<item>
<title>title 02</title>
<description>description 02</description>
</item>
...
How to get all title and description values into a dataset or datareader?

Thank You,
Miguel


For a dataset, if you don't have a schema to give to it, you can tell it
to infer a schema (assuming your xml does follow the format a dataset
normally 'uses'):

http://samples.gotdotnet.com/quickst...apXMLData.aspx

if you had the schema:

http://samples.gotdotnet.com/quickst...etXMLData.aspx

a general primer on the subject:

http://samples.gotdotnet.com/quickst...MLDataSet.aspx

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET
Nov 19 '05 #2
Use dataset.readxml

"Shapper" wrote:
Hello,

I have a XML file that includes the node <item>:
....
<title>...</title>
<url>...</url>
<item>
<title>title 01</title>
<description>description 01</description>
</item>
<item>
<title>title 02</title>
<description>description 02</description>
</item>
....
How to get all title and description values into a dataset or
datareader?

Thank You,
Miguel

Nov 19 '05 #3
Hello,

I know dataset.readxml gets all the data from the xml file and places it
in the dataset. The problem is I don't want to take all data from the
XML file.
I only want to take the data which is inside the <item> nodes.

You can see in my XML file example I have some nodes, for example,
<title> and <url> which I don't want to place in the dataset.

I can't understand how to do this.

Can someone help me out?

Thanks,
Miguel

"Prakash.NET" <Pr********@discussions.microsoft.com> wrote in message
news:Pr********@discussions.microsoft.com:
Use dataset.readxml

"Shapper" wrote:

Hello,

I have a XML file that includes the node <item>:
....
<title>...</title>
<url>...</url>
<item>
<title>title 01</title>
<description>description 01</description>
</item>
<item>
<title>title 02</title>
<description>description 02</description>
</item>
....
How to get all title and description values into a dataset or
datareader?

Thank You,
Miguel


Nov 19 '05 #4
Hi,

DataSet.Reaxml has a overload called DataSet.ReadXml(XmlReader).
This XmlReader can be a XmlNodeReader. Use this node reader to read the
specific node in the xml file and pass it to ReadXML. I am sorry. I don't
have the time to write the code for you.[If this answer helps you, please
click "Yes" in "Was this post helpful to you?" link]

Prakash.NET

"Shapper" wrote:
Hello,

I know dataset.readxml gets all the data from the xml file and places it
in the dataset. The problem is I don't want to take all data from the
XML file.
I only want to take the data which is inside the <item> nodes.

You can see in my XML file example I have some nodes, for example,
<title> and <url> which I don't want to place in the dataset.

I can't understand how to do this.

Can someone help me out?

Thanks,
Miguel

"Prakash.NET" <Pr********@discussions.microsoft.com> wrote in message
news:Pr********@discussions.microsoft.com:
Use dataset.readxml

"Shapper" wrote:

Hello,

I have a XML file that includes the node <item>:
....
<title>...</title>
<url>...</url>
<item>
<title>title 01</title>
<description>description 01</description>
</item>
<item>
<title>title 02</title>
<description>description 02</description>
</item>
....
How to get all title and description values into a dataset or
datareader?

Thank You,
Miguel


Nov 19 '05 #5

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

Similar topics

0
by: thomas | last post by:
I must be doing something obvious wrong here, but: I perform a query to retrieve a dataset - I want to archive this in a SQL field for seperate retrieval later, while the original data may have...
0
by: Plumer | last post by:
Good morning everyone, Using C# I create a bog-standard System.Data.DataTable which I then Add to a System.Data.Dataset. I need to import that structure into an Access .adp file so I have...
6
by: Lester Moreno | last post by:
Hello all, Up to now C# have been an great experience but I found myself in a end of the road problem. Let say that you have two windows program running on a local network area. User1 and...
3
by: Michael S | last post by:
only my server get the report whitout the dialogue database login. I think it is where the database is localhost and the crystal report know not the connection string. how I can crystal reports...
3
by: Hai Nguyen | last post by:
Sorry I don't have code yet. I'm asking for solutions which can help me solve the problem. This is the first time I have to cope this situation, hence I'm clueless how to start. I would like to ask...
3
by: Ben Becker | last post by:
I am trying to build a custom crosstab type of grid where I take some items in a data grid and based on the content of the current item compared to the previous item, determine if a new row in a...
8
by: ASP Yaboh | last post by:
I have an ArrayList of data gathered from a database. I want to create a web page from this data by creating a <table>, each cell in each row displays the appropriate data. One of those cells in...
22
by: Arne | last post by:
How do I pass a dataset to a webservices? I need to submit a shoppingcart from a pocket PC to a webservice. What is the right datatype? II have tried dataset as a datatype, but I can't get it to...
0
by: 2Barter.net | last post by:
newsmail@reuters.uk.ed10.net Fwd: Money for New Orleans, AL & GA Inbox Reply Reply to all Forward Print Add 2Barter.net to Contacts list Delete this message Report phishing Show original
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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
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,...
0
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...

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.