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

Issue loading XML into datagrid...

Hello,

I've an XML file loaded into a dataset. It works fine, but some values
i can't load. For example, <incidentid> is working fine, but
<subjectid> is an issue, because it has a name and dsc parameter. the
same count for <createdon> and <modified on>.
I want to load the dataset into a datagrid and again, without these
fields it works fine, but for whatever reason, i can't access these
different fields. I'm developing in ASP.NET/VB.NET.

Thanks for your help.

Here is my XML file:
<incidents>
<incident>
<incidentid>{6C15B06F-26F2-480E-B060-D59DEC5E2574}</incidentid>
<subjectid name="Hardware"
dsc="0">{B4E919D9-945D-43A3-88E8-2D1C25D40D27}</subjectid>
<title>Can't start my computer</title>
<description>When i want to start my computer it does not
start</description>
<createdon date="19/04/2005" time="01:27
AM">2005-04-19T01:27:04-07:00</createdon>
<ticketnumber>12302003</ticketnumber>
<modifiedon date="19/04/2005" time="01:29
AM">2005-04-19T01:29:59-07:00</modifiedon>
<statuscode name="Problem Solved">5</statuscode>
</incident>
<incident>
<incidentid>{9E7CA80E-5979-4C4F-B196-72AA6D5035A4}</incidentid>
<subjectid name="Software"
dsc="0">{8E78CD49-9B15-4706-AC52-0A28082FB80A}</subjectid>
<title>How can i copy paste in word?</title>
<description>I want to copy paste text in word, how can i do this
?</description>
<createdon date="14/04/2005" time="06:30
AM">2005-04-14T06:30:20-07:00</createdon>
<ticketnumber>12302002</ticketnumber>
<modifiedon date="19/04/2005" time="01:24
AM">2005-04-19T01:24:18-07:00</modifiedon>
<statuscode name="Problem Solved">5</statuscode>
</incident>
</incidents>

Nov 19 '05 #1
2 934
Observation:
i have loaded this xml into my dataset and checked the functionality.
It is basically creating 5 tables :O.
table 1: your marster table and rest all are the tables containing the
attribute values as reference tables.
To bind and display it in the grid, you need to use itemdatabound event
handler and get the data for those attributes from the corresponding tables.

The tables created in your case can be seen in this schema:
1. incident
2. subjectid
3. createdon
4. modifiedon
5. statuscode

Hope this helps!!
Ural
"Eddy" wrote:
Hello,

I've an XML file loaded into a dataset. It works fine, but some values
i can't load. For example, <incidentid> is working fine, but
<subjectid> is an issue, because it has a name and dsc parameter. the
same count for <createdon> and <modified on>.
I want to load the dataset into a datagrid and again, without these
fields it works fine, but for whatever reason, i can't access these
different fields. I'm developing in ASP.NET/VB.NET.

Thanks for your help.

Here is my XML file:
<incidents>
<incident>
<incidentid>{6C15B06F-26F2-480E-B060-D59DEC5E2574}</incidentid>
<subjectid name="Hardware"
dsc="0">{B4E919D9-945D-43A3-88E8-2D1C25D40D27}</subjectid>
<title>Can't start my computer</title>
<description>When i want to start my computer it does not
start</description>
<createdon date="19/04/2005" time="01:27
AM">2005-04-19T01:27:04-07:00</createdon>
<ticketnumber>12302003</ticketnumber>
<modifiedon date="19/04/2005" time="01:29
AM">2005-04-19T01:29:59-07:00</modifiedon>
<statuscode name="Problem Solved">5</statuscode>
</incident>
<incident>
<incidentid>{9E7CA80E-5979-4C4F-B196-72AA6D5035A4}</incidentid>
<subjectid name="Software"
dsc="0">{8E78CD49-9B15-4706-AC52-0A28082FB80A}</subjectid>
<title>How can i copy paste in word?</title>
<description>I want to copy paste text in word, how can i do this
?</description>
<createdon date="14/04/2005" time="06:30
AM">2005-04-14T06:30:20-07:00</createdon>
<ticketnumber>12302002</ticketnumber>
<modifiedon date="19/04/2005" time="01:24
AM">2005-04-19T01:24:18-07:00</modifiedon>
<statuscode name="Problem Solved">5</statuscode>
</incident>
</incidents>

Nov 19 '05 #2
Ural,

Thanks for your reply.

I understand what you're writing here, but i've no clue how to do it.
The code i've right now is the following:
Dim docIncidents As System.Xml.XmlDocument =
xmldocIncidents.getIncidents(varAccountGUID)
Dim readerIncidents As New XmlNodeReader(docIncidents)

Dim dsIncidents As New DataSet
dsIncidents.ReadXml(readerIncidents)
readerIncidents.Close()

DGCases.DataSource = dsIncidents.Tables(0).DefaultView
DGCases.DataBind()

This all works, but only with the "master table". Do i maybe need to
change Tables(0) into Tables(1) to get to the other data ???

Thanks a lot.

Regards,

Eddy

Nov 19 '05 #3

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

Similar topics

4
by: Chan | last post by:
When I try to change the header text after Databind for a column (ASP.Net) I am getting the following error dgTest.Columns(0).HeaderText = "TEST# Index was out of range. Must be non-negative and...
1
by: Sunny | last post by:
Hi, I am using Databases in my applications, i have a table with an average of 3.5 million records, i am trying to show the search results in a DataGrid from that table, but the results take a very...
5
by: John Richardson | last post by:
I've been bothered for some time about my DataGrid not populating my rows very quickly. I have about 10K rows loading into the grid. I create a datatable dt with 2 columns, an ID and a display. ...
1
by: Bala | last post by:
Hi, Currently i am loading the file names into datagrid (unbound) from a folder(sub folders too). so for this i am using this below code. but its too slow to loading all the file names. is it...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.