Click here to Skip to main content
15,921,371 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello House, it Maybe I was using a wrong appraoch
All this while, I want to see if I will able
To insert feed description, title, link, and publish date
Into a database, by so doing, I will be able to manipulate as I want. The code is still the same:

<asp:Repeater ID="Repeater1" runat="server"
             DataSourceID="XmlDataSource1" onitemdatabound="Repeater1_ItemDataBound" >
                 <asp:HyperLink runat="server" ID="TitleLabel1" NavigateUrl='<%#string.Format("Default.aspx?News={0}", HttpUtility.UrlEncode(XPath("title").ToString()))%>' Text='<%#XPath("title")%>'><br />
                 <%#DateTime.Parse(XPath("pubDate").ToString()).ToString("MMMM dd, yyyy")%>
                 <asp:Label ID ="Desc" runat="server" Text='<%#XPath("description")%>' style="display:none;"><br />
                 <hr style="color:#0099ff;" /><br />

I am using Xml datasource, any idea on how to
Insert this to a database will be appreciated. Thanks in advance
Updated 15-Jan-14 17:49pm
bowlturner 16-Jan-14 9:03am    
Do you already have your table structure in the db where you want to put the data?
Uwakpeter 16-Jan-14 10:19am    
yes i have my table structure with the following fields: link, title, description, pubDate, author.
bowlturner 16-Jan-14 10:23am    
then create a connection to the db, create an insert command with parameters you need, loop through the XML parse the values into the parameters fields and run the insert command
Uwakpeter 16-Jan-14 10:25am    
i don't know how to loop through the xml

1 solution

Here is a really good code set to help you. This will return a list of RSS data items given the URL of the feed:[^]
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900