473,503 Members | 2,159 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to bind this XML data?

Hello,

I have a XML which contains 2 data types:
1. Data which is not repeated. (<title>, <link>)
2. Repeating data. (<item>)

My XML File:
<channel>
<title>...</title>
<link>...</link>
<item>
<title>4 Web Version 1.0 is available since today!</title>
<link></link>
<description>...</description>
<pubDate>...</pubDate>
</item>
...

I was able to place data in (1) in the HeaderTemplate of my Repeater.

Now I need to place the repeating data in the ItemTemplate of my
Repeater.

I have this:
news.Load(Server.MapPath("xml/news.rss"))
rptNews.DataSource = news.SelectNodes("channel/item")
rptNews.DataBind()

It's not working. When I use <%# DataBinder.Eval(Container.DataItem,
"title") %> in my aspx code I get the error: DataBinder.Eval:
'System.Xml.XmlElement' does not contain a property with the name title.

I suppose I need to get the XML data into a dataset and then bind it to
my repeater. Is that right?

How can I solve this?

Thank You,
Miguel

Nov 19 '05 #1
2 1014
Try:
<%# ((System.Xml.XmlNode)Container.DataItem).InnerText %>

Article of using XML in DataGrid:
http://blogs.msdn.com/kaevans/archiv...7/04/9713.aspx

Hope this helps.

Nov 19 '05 #2
Oh, sorry. I think that code in my first post had a bug.
It should have been:

<%#((System.Xml.XmlNode)Container.DataItem).Select SingleNode("title").InnerText %>
Nov 19 '05 #3

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

Similar topics

1
4657
by: Daniel Roy | last post by:
Hi gurus, I just started to look at a very slow-running SQL statement generated by an application (Siebel). I spooled the SQL from the application, replaced the bind variables by their values, and...
3
3776
by: Dmitry Korolyov [MVP] | last post by:
Is that possible? In other words, I want a dropdown list (and other list-type controls) which appears in edit more of a templated column to be populated with data at the run time. An attempt to do so...
4
4076
by: Greg Linwood | last post by:
I am wondering what the best approach to binding XML data to an asp:Table from the Page_Load event in a code behind module? I'm using VB.Net and initially approached this by adding a table to the...
6
5308
by: coleenholley | last post by:
I have a Class Module written in VB that calls an RPC (written in COBOL) we have written code to read the data from the RPC, and we create a temporary datatable to store the data from the RPC. This...
3
2288
by: AFN | last post by:
I need to manually create the data to be shown in a datagrid (or some data table object). Should I create an array and bind the array to the datagrid OR should I create a temporary dataset and...
1
1822
by: mr2_93 | last post by:
Hi All, I am new to ASP.NET and I am looking for help with the dropdownlist data control. I wonder if someone could show me how to past the SelectedValue of a data-bind dropdownlist to...
17
2730
by: A_PK | last post by:
I have problem databinding the DataGrid with DataView/DataSet after the filter... I create the following proceudre in order for user to filter as many as they want, but the following code is only...
3
3269
by: serge calderara | last post by:
Dear all, Does anyone know how to bind a System.Collection.ArraysList object to a Dataset ? Thanks for your reply Regards Serge
2
17906
by: M.Caggiano | last post by:
Hi! This code wants to simulate a possible answer of a server, to an application of connection aside a client. The server has to accept the connection and send a message with its name. The all...
1
5333
by: Linda Liu[MSFT] | last post by:
Hi George, Thank you for posting! This is a quick note to let you know that I am doing research on this issue and will get back to you ASAP. I appreciate your patience! Sincerely,
0
7205
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
7287
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,...
1
7011
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5596
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,...
1
5023
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...
0
4689
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3180
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
747
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
401
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.