473,224 Members | 1,393 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,224 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 1944
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...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.