c#
Archive for December, 2007
c#.net
December 19, 2007asp.net
December 19, 2007RSS 2.0.1 has the internal version number 2.0. RSS 2.0.1 was proclaimed to be “frozen”, but still updated shortly after release without changing the version number. RSS now stood for Really Simple Syndication. The major change in this version is an explicit extension mechanism using XML Namespaces
RSS 2.0
The following is an example of an RSS 2.0 file.
<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>Liftoff News</title>
<link>http://liftoff.msfc.nasa.gov/</link>
<description>Liftoff to Space Exploration.</description>
<language>en-us</language>
<pubDate>Tue, 10 Jun 2003 04:00:00 GMT</pubDate>
<lastBuildDate>Tue, 10 Jun 2003 09:41:01 GMT</lastBuildDate>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<generator>Weblog Editor 2.0</generator>
<managingEditor>editor@example.com</managingEditor>
<webMaster>webmaster@example.com</webMaster>
<item>
<title>Star City</title>
<link>http://liftoff.msfc.nasa.gov/news/2003/news-starcity.asp</link>
<description>How do Americans get ready to work with Russians aboard the
International Space Station? They take a crash course in culture, language
and protocol at Russia's Star City.</description>
<pubDate>Tue, 03 Jun 2003 09:39:21 GMT</pubDate>
<guid>http://liftoff.msfc.nasa.gov/2003/06/03.html#item573</guid>
</item>
<item>
<title>Space Exploration</title>
<link>http://liftoff.msfc.nasa.gov/</link>
<description>Sky watchers in Europe, Asia, and parts of Alaska and Canada
will experience a partial eclipse of the Sun on Saturday, May 31st.</description>
<pubDate>Fri, 30 May 2003 11:06:42 GMT</pubDate>
<guid>http://liftoff.msfc.nasa.gov/2003/05/30.html#item572</guid>
</item>
<item>
<title>The Engine That Does More</title>
<link>http://liftoff.msfc.nasa.gov/news/2003/news-VASIMR.asp</link>
<description>Before man travels to Mars, NASA hopes to design new engines
that will let us fly through the Solar System more quickly. The proposed
VASIMR engine would do that.</description>
<pubDate>Tue, 27 May 2003 08:37:32 GMT</pubDate>
<guid>http://liftoff.msfc.nasa.gov/2003/05/27.html#item571</guid>
</item>
<item>
<title>Astronauts' Dirty Laundry</title>
<link>http://liftoff.msfc.nasa.gov/news/2003/news-laundry.asp</link>
<description>Compared to earlier spacecraft, the International Space
Station has many luxuries, but laundry facilities are not one of them.
Instead, astronauts have other options.</description>
<pubDate>Tue, 20 May 2003 08:56:02 GMT</pubDate>
<guid>http://liftoff.msfc.nasa.gov/2003/05/20.html#item570</guid>
</item>
</channel>
</rss>
http://www.uberasp.net/getarticle.aspx?id=17
http://msdn2.microsoft.com/en-us/library/aa478968.aspx
http://blogs.msdn.com/shahpiyush/archive/2007/06/16/3331941.aspx
http://www.oreilly.com/catalog/consynrss/toc.html
GOOD
http://cyber.law.harvard.edu/rss/rss.html
msdn of syndication
http://msdn2.microsoft.com/en-us/library/bb412203.aspx
rss feed
Response.Clear();
Response.ContentType = “text/xml”;
XmlTextWriter xtwFeed = new XmlTextWriter(Response.OutputStream, Encoding.UTF8);
xtwFeed.WriteStartDocument();
// The mandatory rss tag
xtwFeed.WriteStartElement(“rss”);
xtwFeed.WriteAttributeString(“version”, “2.0”);
// The channel tag contains RSS feed details
xtwFeed.WriteStartElement(“channel”);
xtwFeed.WriteElementString(“title”, “Feedpedia Today’s World News”);
xtwFeed.WriteElementString(“link”, “http://www.feedpedia.com”);
xtwFeed.WriteElementString(“description”, “The latest news and journals from all over the world.”);
xtwFeed.WriteElementString(“copyright”, “Copyright 2005 – 2006 Feedpedia.com. All rights reserved.”);
// Objects needed for connecting to the SQL database
SqlConnection SqlCon;
SqlCommand SqlCom;
SqlDataReader SqlDR;
// Edit to match your connection string
SqlCon = new SqlConnection(ConfigurationManager.ConnectionStrings[“ConnectionString”].ToString());
// Edit to match your stored procedure or SQL command
SqlCom = new SqlCommand(“GetTodaysHeadlines”, SqlCon);
SqlCom.CommandType = CommandType.StoredProcedure;
if (SqlCon.State == ConnectionState.Closed)
{
SqlCon.Open();
}
SqlDR = SqlCom.ExecuteReader();
// Loop through the content of the database and add them to the RSS feed
while (SqlDR.Read())
{
xtwFeed.WriteStartElement(“item”);
xtwFeed.WriteElementString(“title”, SqlDR[“Title”].ToString());
xtwFeed.WriteElementString(“description”, SqlDR[“Description”].ToString());
xtwFeed.WriteElementString(“link”, “http://www.feedpedia.com/View.aspx?View=” + SqlDR[“ID”]);
xtwFeed.WriteElementString(“pubDate”, SqlDR[“Date”].ToString());
xtwFeed.WriteEndElement();
}
SqlDR.Close();
SqlCon.Close();
// Close all tags
xtwFeed.WriteEndElement();
xtwFeed.WriteEndElement();
xtwFeed.WriteEndDocument();
xtwFeed.Flush();
xtwFeed.Close();
Response.End();
Hello world!
December 19, 2007Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!