Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I would like to read a Xml feed from a website and store it in a SQL Table .
I was sucessful in reading and displaying the XML in specific format , but i was not able to feed it into a SQL table.


For example :

I have this XML link (RSS ) : http://www.nsf.gov/rss/rss_www_funding_upcoming_cise.xml

I created a SQL table with columns NAME,PUB_DATE,DESC .

How do i map the information to this table?

Also how to update the tables automatically when the Xml feed changes ?


This is my first post and also i know this community is very active.

I kindly request you guys to guide me through this.
I am using Visual Studio 2010.


XML
<asp:DataGrid runat="server" ID="myPosts" AutoGenerateColumns="False">
           <columns>
               <asp:TemplateColumn HeaderText="My Posts">
                   <itemtemplate>
                       <a href="<%# DataBinder.Eval(Container.DataItem, " link=")%>">
                           <%# DataBinder.Eval(Container.DataItem, "title") %>
                       </a>
                   </itemtemplate>
           </columns>


code behind

XmlTextReader reader = new XmlTextReader("http://www.nsf.gov/rss/rss_www_funding_upcoming_cise.xml");

DataSet ds = new DataSet();

ds.ReadXml(reader);

myPosts.DataSource = ds;
myPosts.DataBind();


here i need to insert data to database table using ado.net....please help me
Posted
Updated 12-May-15 20:44pm
v2

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