473,394 Members | 1,701 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,394 software developers and data experts.

ReadXml to read recurring occurences of same tag?

Hello,

I have an xml file with the following snippet:

....... some tags
<ListItems>
<item> 1 </item>
<item> 2 </item>
<item> 3 </item>
</ListItems>

I need to populate a dataset containing a table with one column "Item"
with rows containining data from the item tag....i.e. 1,2,3.

if i Create a DataTable named "ListItems" and a column element in it
named "item" then only the first value is read.

if i Create a DataTable named "item" then no values are read but
exactly the same no. of rows are created in the grid having this
dataset as the source..... this is definitely a good sign as now I need
to get the data somehow.... but HOW?
Please help!

Thanks,
Vinit

Feb 7 '06 #1
4 1948
Are you using DatSet.ReadXml() ?????

--

Juan David Gómez Arenas.
Ingeniero de Desarrollo
InterGrupo S.A. - Medellín
Visite nuestro sitio: www.intergrupo.com
"Vinit" <vi********@gmail.com> wrote in message
news:11*********************@g44g2000cwa.googlegro ups.com...
Hello,

I have an xml file with the following snippet:

...... some tags
<ListItems>
<item> 1 </item>
<item> 2 </item>
<item> 3 </item>
</ListItems>

I need to populate a dataset containing a table with one column "Item"
with rows containining data from the item tag....i.e. 1,2,3.

if i Create a DataTable named "ListItems" and a column element in it
named "item" then only the first value is read.

if i Create a DataTable named "item" then no values are read but
exactly the same no. of rows are created in the grid having this
dataset as the source..... this is definitely a good sign as now I need
to get the data somehow.... but HOW?
Please help!

Thanks,
Vinit

Feb 7 '06 #2
Yes i am using dataset.readxml.

Feb 7 '06 #3
Hi Vinit,

If you are using DataSet.ReadXml, then there should be no problem.
This solution does not use a DataTable.
-----------------------------------------------------
Dim ds As DataSet = New DataSet()
ds.ReadXml("Temp.xml")

'Display the resulting Dataset into a Datagrid called dg
dg.DataSource = ds
dg.DataMember = "item"
------------------------------------------------------

Regards,

Cerebrus

Feb 8 '06 #4
Well I figured it out ....I was using ReadXml with the default
ReadSchema mode.....i used the InferSchema as the XmlReadMode and it
worked fine.....

Thanks 2 all who replied!

Feb 8 '06 #5

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

Similar topics

5
by: James Morton | last post by:
I have a Static DataSet in a class file that I am using globally between a few forms. The main form populates the dataset through a menu option which invokes ReadXML in the class file to populate...
3
by: Raj Chudasama | last post by:
I am trying to read an xml file and have it view data in the datagrid. (For example take the xml file viewer in the visual studio, when u open an xml file it has that nice readable grid). I...
1
by: steve | last post by:
Hi All I am writing a program for a gymnasium for membership control It is the first time I have had to deal with appointment diaries and I want to know the best way to store recurring...
2
by: matthias | last post by:
I am creating a database which is supposed to contain many data entries (events) that differ only in the date they occur. So let's say event 1 occurs every Monday, Tuesday and Sunday between...
2
by: nepdae | last post by:
Please forgive me, this is a long one. My 11-user Access 2000 database is having recurring corruption problems. The symptoms include the following: 1) corrupted fields in recently created or...
1
by: keikoo | last post by:
Hi, I,m trying to fill a DataSet with a xml file, so I pretend to use the ReadXml method. The .xsd file is defined, and the fields of the xml file have the same name and type than the DataTable...
1
by: ray well | last post by:
i saved the state of a data set and table via MyDs.WriteXmlSchema("MyDs.xsd") MyDs.WriteXml("MyDs.xml") i was able to read them back in and display the info in the database by ...
0
by: =?Utf-8?B?TWVlbWEgSnVkeQ==?= | last post by:
I have a Verizon Palm Treo 755p and use Outlook 2002 on my new HP Pavilion (Vista 64-bit). When I was syncing on my old XP PC, everything worked fine. On the Vista PC, when I finally got it to...
2
by: Tony Johansson | last post by:
Hello! Assume the following : 1. I create a DataSet with some DataRelation. 2. I then use WriteXml to write the DataSet to an Xml document using DataRelation.Nested = True 3.I then read the...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.