Creating an RSS Feed with ASP.Net Written in C#
(Page 1 of 4 )
RSS feeds are massively popular online. It's no wonder; they're a great way for users to receive news, blog entries, and other content in which they're interested. If you want to set one up for your web site, keep reading.
What is RSS?
RSS. Your probably already know what this is, but put simply RSS (Really Simple Syndication) is just an XML file served up by a web server, normally containing news items, stock prices and so forth.
The file contains certain tags that define it as an RSS feed (such as the opening <rss version="2.0"> tag).
RSS feed readers such SharpReader can use these XML files and display their content, headlines and more. These readers mean that, from one place, you can easily see all the news and information to which you have subscribed.
In this article, we will go though creating an RSS feed, using an ASP.Net web page, written in C#. We will also need to have a back end SQL server database that contains the news stories we are going to put into the RSS feed.
Layout of Database table
First of all, we need to have the database with some stories in it. For this article we will be using a table as described in the table below.
Field name | Field Type | Notes |
id | Unique integer id of the field | ID of the story |
headline | VarChar field, 75 long | Headline of the story |
story_text | Text field | Full text of the story |
If you are creating the database from scratch, make sure there is some test data in there to use. The headline field will be what most people first see in the RSS reader application.
Once you have the above table (call it something like tbl_stories), you can start to create the ASP.Net page that will serve the feed.
Next: Creating the Pages >>
More C# Articles
More By Luke Niland