Hi all
How can i return images from my database (Access) to RSS in form of thumbnails
this is my RSS code:
Imports System.Data.OleDb
Imports System.Xml
Imports System.ServiceModel.Syndication
Partial Public Class RSS
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Response.ContentType = "application/rss+xml"
Dim myFeed As New SyndicationFeed
myFeed.Title = TextSyndicationContent.CreatePlaintextContent("ASP.Net developers")
myFeed.Description = TextSyndicationContent.CreatePlaintextContent("The five most recent articals of ASP.Net Developers Website")
myFeed.Links.Add(SyndicationLink.CreateSelfLink(New Uri(myURL("List.aspx"))))
myFeed.Language = "en-uk"
Dim oleDbConn As New OleDbConnection(ConfigurationManager.ConnectionStrings("Developers").ConnectionString)
oleDbConn.Open()
Dim cmdQuery As String = "select top 6 * from List,Details "
Dim dbcomm = New OleDbCommand(cmdQuery, oleDbConn)
Dim dbread = dbcomm.ExecuteReader()
Dim myList As New List(Of SyndicationItem)
While dbread.Read()
Dim sList As New SyndicationItem
sList.Title = mkRssTxt(dbread("Title"))
' sList.Authors = mkRssTxt(dbread("Author"))
sList.Summary = mkRssTxt(dbread("Introduction"))
' sList.Links.Add(mkRssLink(dbread("Link")))
' sList.PublishDate = dbread("TDate")
sList.Content = mkRssTxt(dbread("Details"))
myList.Add(sList)
End While
myFeed.Items = myList
Dim feedwriter As XmlWriter = XmlWriter.Create(Response.OutputStream)
Dim rssFormatter = New Rss20FeedFormatter(myFeed)
rssFormatter.WriteTo(feedwriter)
feedwriter.Close()
End Sub
Private Function mkRssLink(ByVal someLocation As String) As SyndicationLink
Return SyndicationLink.CreateAlternateLink(New Uri(someLocation))
End Function
Private Function mkRssTxt(ByVal someString As String) As TextSyndicationContent
Return TextSyndicationContent.CreatePlaintextContent(someString)
End Function
Private Function myURL(ByVal urlStr As String)
Return Request.Url.GetLeftPart(UriPartial.Authority) & ResolveUrl(urlStr)
End Function
End Class
i will appreciate any help
Mona