Click here to Skip to main content
Click here to Skip to main content
Articles » Languages » VB.NET » Utilities » Downloads
 
Add your own
alternative version

RSS News Reader

, 10 May 2005
A VB.NET RSS news reader. RSS sites are stored in an Access database, and items can be selected from a DataGrid. Selected news items are displayed in an embedded browser.
rssnewsreadervbexecutable.zip
AxInterop.SHDocVw.dll
Interop.SHDocVw.dll
rss.mdb
RssReader.exe
rssnewsreadervbsource.zip
rss.mdb
RssReader.vbproj.user
DataSet1.xsx
Public Class frmMainForm
    Inherits System.Windows.Forms.Form
    'Variable to store and update number of news items selected for viewing and the items viewed
    Dim intItemstoView As Integer = 0
    Dim intItemViewed As Integer = 0
#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents OleDbConnection1 As System.Data.OleDb.OleDbConnection
    Friend WithEvents DataSet11 As RssReader.DataSet1
    Friend WithEvents OleDbSelectCommand2 As System.Data.OleDb.OleDbCommand
    Friend WithEvents OleDbInsertCommand2 As System.Data.OleDb.OleDbCommand
    Friend WithEvents OleDbUpdateCommand2 As System.Data.OleDb.OleDbCommand
    Friend WithEvents OleDbDeleteCommand2 As System.Data.OleDb.OleDbCommand
    Friend WithEvents dgdtabstyleItems As System.Windows.Forms.DataGridTableStyle
    Friend WithEvents dgdtextcolTitle As System.Windows.Forms.DataGridTextBoxColumn
    Friend WithEvents dgdboolcolView As System.Windows.Forms.DataGridBoolColumn
    Friend WithEvents dgdtextcolDescription As System.Windows.Forms.DataGridTextBoxColumn
    Friend WithEvents btnNext As System.Windows.Forms.Button
    Friend WithEvents btnPrevious As System.Windows.Forms.Button
    Friend WithEvents lblPosition As System.Windows.Forms.Label
    Friend WithEvents OleDbSelectCommand3 As System.Data.OleDb.OleDbCommand
    Friend WithEvents OleDbInsertCommand3 As System.Data.OleDb.OleDbCommand
    Friend WithEvents pgsBrowser As System.Windows.Forms.ProgressBar
    Friend WithEvents mnuMainMenu As System.Windows.Forms.MainMenu
    Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem
    Friend WithEvents mnuGetFeeds As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem5 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem6 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem8 As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem11 As System.Windows.Forms.MenuItem
    Friend WithEvents mnuSelectAllFeeds As System.Windows.Forms.MenuItem
    Friend WithEvents mnuGetSelectedItems As System.Windows.Forms.MenuItem
    Friend WithEvents mnuSelectAllItems As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem2 As System.Windows.Forms.MenuItem
    Friend WithEvents mnuDeleteItemsNotSelected As System.Windows.Forms.MenuItem
    Friend WithEvents mnuDeleteAllItems As System.Windows.Forms.MenuItem
    Friend WithEvents mnuClearItemSelections As System.Windows.Forms.MenuItem
    Friend WithEvents mnuBrowserNextPage As System.Windows.Forms.MenuItem
    Friend WithEvents mnuBrowserPreviousPage As System.Windows.Forms.MenuItem
    Friend WithEvents mnuClearSiteSelections As System.Windows.Forms.MenuItem
    Friend WithEvents OleDbdaItem As System.Data.OleDb.OleDbDataAdapter
    Friend WithEvents OleDbdaViewItems As System.Data.OleDb.OleDbDataAdapter
    Friend WithEvents webBrowser0 As AxSHDocVw.AxWebBrowser
    Friend WithEvents dgdSites As System.Windows.Forms.DataGrid
    Friend WithEvents dgdtsSites As System.Windows.Forms.DataGridTableStyle
    Friend WithEvents dgdboolcolViewSite As System.Windows.Forms.DataGridBoolColumn
    Friend WithEvents dgdtextcolSiteName As System.Windows.Forms.DataGridTextBoxColumn
    Friend WithEvents dgdtextcolDesc As System.Windows.Forms.DataGridTextBoxColumn
    Friend WithEvents tooltipMain As System.Windows.Forms.ToolTip
    Friend WithEvents MenuItem3 As System.Windows.Forms.MenuItem
    Friend WithEvents mnuAddSite As System.Windows.Forms.MenuItem
    Friend WithEvents MenuItem4 As System.Windows.Forms.MenuItem
    Friend WithEvents mnuAbout As System.Windows.Forms.MenuItem
    Friend WithEvents mnuWebHelp As System.Windows.Forms.MenuItem
    Friend WithEvents dgdItems As System.Windows.Forms.DataGrid
    Friend WithEvents OleDbdaSites As System.Data.OleDb.OleDbDataAdapter
    Friend WithEvents OleDbSelectCommand1 As System.Data.OleDb.OleDbCommand
    Friend WithEvents OleDbInsertCommand1 As System.Data.OleDb.OleDbCommand
    Friend WithEvents OleDbUpdateCommand1 As System.Data.OleDb.OleDbCommand
    Friend WithEvents OleDbDeleteCommand1 As System.Data.OleDb.OleDbCommand
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container
        Dim configurationAppSettings As System.Configuration.AppSettingsReader = New System.Configuration.AppSettingsReader
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmMainForm))
        Me.DataSet11 = New RssReader.DataSet1
        Me.OleDbConnection1 = New System.Data.OleDb.OleDbConnection
        Me.OleDbdaItem = New System.Data.OleDb.OleDbDataAdapter
        Me.OleDbDeleteCommand2 = New System.Data.OleDb.OleDbCommand
        Me.OleDbInsertCommand2 = New System.Data.OleDb.OleDbCommand
        Me.OleDbSelectCommand2 = New System.Data.OleDb.OleDbCommand
        Me.OleDbUpdateCommand2 = New System.Data.OleDb.OleDbCommand
        Me.dgdItems = New System.Windows.Forms.DataGrid
        Me.dgdtabstyleItems = New System.Windows.Forms.DataGridTableStyle
        Me.dgdboolcolView = New System.Windows.Forms.DataGridBoolColumn
        Me.dgdtextcolTitle = New System.Windows.Forms.DataGridTextBoxColumn
        Me.dgdtextcolDescription = New System.Windows.Forms.DataGridTextBoxColumn
        Me.webBrowser0 = New AxSHDocVw.AxWebBrowser
        Me.btnNext = New System.Windows.Forms.Button
        Me.btnPrevious = New System.Windows.Forms.Button
        Me.lblPosition = New System.Windows.Forms.Label
        Me.OleDbdaViewItems = New System.Data.OleDb.OleDbDataAdapter
        Me.OleDbInsertCommand3 = New System.Data.OleDb.OleDbCommand
        Me.OleDbSelectCommand3 = New System.Data.OleDb.OleDbCommand
        Me.pgsBrowser = New System.Windows.Forms.ProgressBar
        Me.mnuMainMenu = New System.Windows.Forms.MainMenu
        Me.MenuItem1 = New System.Windows.Forms.MenuItem
        Me.mnuGetFeeds = New System.Windows.Forms.MenuItem
        Me.MenuItem5 = New System.Windows.Forms.MenuItem
        Me.mnuSelectAllFeeds = New System.Windows.Forms.MenuItem
        Me.mnuClearSiteSelections = New System.Windows.Forms.MenuItem
        Me.MenuItem3 = New System.Windows.Forms.MenuItem
        Me.mnuAddSite = New System.Windows.Forms.MenuItem
        Me.MenuItem6 = New System.Windows.Forms.MenuItem
        Me.mnuGetSelectedItems = New System.Windows.Forms.MenuItem
        Me.MenuItem8 = New System.Windows.Forms.MenuItem
        Me.mnuSelectAllItems = New System.Windows.Forms.MenuItem
        Me.mnuClearItemSelections = New System.Windows.Forms.MenuItem
        Me.MenuItem2 = New System.Windows.Forms.MenuItem
        Me.mnuDeleteItemsNotSelected = New System.Windows.Forms.MenuItem
        Me.mnuDeleteAllItems = New System.Windows.Forms.MenuItem
        Me.MenuItem11 = New System.Windows.Forms.MenuItem
        Me.mnuBrowserNextPage = New System.Windows.Forms.MenuItem
        Me.mnuBrowserPreviousPage = New System.Windows.Forms.MenuItem
        Me.MenuItem4 = New System.Windows.Forms.MenuItem
        Me.mnuWebHelp = New System.Windows.Forms.MenuItem
        Me.mnuAbout = New System.Windows.Forms.MenuItem
        Me.dgdSites = New System.Windows.Forms.DataGrid
        Me.dgdtsSites = New System.Windows.Forms.DataGridTableStyle
        Me.dgdboolcolViewSite = New System.Windows.Forms.DataGridBoolColumn
        Me.dgdtextcolSiteName = New System.Windows.Forms.DataGridTextBoxColumn
        Me.dgdtextcolDesc = New System.Windows.Forms.DataGridTextBoxColumn
        Me.tooltipMain = New System.Windows.Forms.ToolTip(Me.components)
        Me.OleDbdaSites = New System.Data.OleDb.OleDbDataAdapter
        Me.OleDbDeleteCommand1 = New System.Data.OleDb.OleDbCommand
        Me.OleDbInsertCommand1 = New System.Data.OleDb.OleDbCommand
        Me.OleDbSelectCommand1 = New System.Data.OleDb.OleDbCommand
        Me.OleDbUpdateCommand1 = New System.Data.OleDb.OleDbCommand
        CType(Me.DataSet11, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.dgdItems, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.webBrowser0, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.dgdSites, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'DataSet11
        '
        Me.DataSet11.DataSetName = "DataSet1"
        Me.DataSet11.Locale = New System.Globalization.CultureInfo("en-US")
        '
        'OleDbConnection1
        '
        Me.OleDbConnection1.ConnectionString = "Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Registry Path=;Jet OLEDB:Database L" & _
        "ocking Mode=1;Jet OLEDB:Database Password=;Data Source=""rss.mdb"";Password=;Jet O" & _
        "LEDB:Engine Type=5;Jet OLEDB:Global Bulk Transactions=1;Provider=""Microsoft.Jet." & _
        "OLEDB.4.0"";Jet OLEDB:System database=;Jet OLEDB:SFP=False;Extended Properties=;M" & _
        "ode=Share Deny None;Jet OLEDB:New Database Password=;Jet OLEDB:Create System Dat" & _
        "abase=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Witho" & _
        "ut Replica Repair=False;User ID=Admin;Jet OLEDB:Encrypt Database=False"
        '
        'OleDbdaItem
        '
        Me.OleDbdaItem.DeleteCommand = Me.OleDbDeleteCommand2
        Me.OleDbdaItem.InsertCommand = Me.OleDbInsertCommand2
        Me.OleDbdaItem.SelectCommand = Me.OleDbSelectCommand2
        Me.OleDbdaItem.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "item", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("author", "author"), New System.Data.Common.DataColumnMapping("description", "description"), New System.Data.Common.DataColumnMapping("id", "id"), New System.Data.Common.DataColumnMapping("link", "link"), New System.Data.Common.DataColumnMapping("pubdate", "pubdate"), New System.Data.Common.DataColumnMapping("title", "title"), New System.Data.Common.DataColumnMapping("View", "View")})})
        Me.OleDbdaItem.UpdateCommand = Me.OleDbUpdateCommand2
        '
        'OleDbDeleteCommand2
        '
        Me.OleDbDeleteCommand2.CommandText = "DELETE FROM item WHERE (id = ?) AND ([View] = ?) AND (author = ? OR ? IS NULL AND" & _
        " author IS NULL) AND (description = ? OR ? IS NULL AND description IS NULL) AND " & _
        "(link = ? OR ? IS NULL AND link IS NULL) AND (pubdate = ? OR ? IS NULL AND pubda" & _
        "te IS NULL) AND (title = ? OR ? IS NULL AND title IS NULL)"
        Me.OleDbDeleteCommand2.Connection = Me.OleDbConnection1
        Me.OleDbDeleteCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_id", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "id", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_View", System.Data.OleDb.OleDbType.Boolean, 2, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "View", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_author", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "author", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_author1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "author", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_description", System.Data.OleDb.OleDbType.VarWChar, 250, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "description", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_description1", System.Data.OleDb.OleDbType.VarWChar, 250, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "description", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_link", System.Data.OleDb.OleDbType.VarWChar, 250, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "link", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_link1", System.Data.OleDb.OleDbType.VarWChar, 250, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "link", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_pubdate", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "pubdate", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_pubdate1", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "pubdate", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_title", System.Data.OleDb.OleDbType.VarWChar, 250, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "title", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_title1", System.Data.OleDb.OleDbType.VarWChar, 250, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "title", System.Data.DataRowVersion.Original, Nothing))
        '
        'OleDbInsertCommand2
        '
        Me.OleDbInsertCommand2.CommandText = "INSERT INTO item(author, description, link, pubdate, title, [View]) VALUES (?, ?," & _
        " ?, ?, ?, ?)"
        Me.OleDbInsertCommand2.Connection = Me.OleDbConnection1
        Me.OleDbInsertCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("author", System.Data.OleDb.OleDbType.VarWChar, 50, "author"))
        Me.OleDbInsertCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("description", System.Data.OleDb.OleDbType.VarWChar, 250, "description"))
        Me.OleDbInsertCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("link", System.Data.OleDb.OleDbType.VarWChar, 250, "link"))
        Me.OleDbInsertCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("pubdate", System.Data.OleDb.OleDbType.DBDate, 0, "pubdate"))
        Me.OleDbInsertCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("title", System.Data.OleDb.OleDbType.VarWChar, 250, "title"))
        Me.OleDbInsertCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("View", System.Data.OleDb.OleDbType.Boolean, 2, "View"))
        '
        'OleDbSelectCommand2
        '
        Me.OleDbSelectCommand2.CommandText = "SELECT author, description, id, link, pubdate, title, [View] FROM item"
        Me.OleDbSelectCommand2.Connection = Me.OleDbConnection1
        '
        'OleDbUpdateCommand2
        '
        Me.OleDbUpdateCommand2.CommandText = "UPDATE item SET author = ?, description = ?, link = ?, pubdate = ?, title = ?, [V" & _
        "iew] = ? WHERE (id = ?) AND ([View] = ?) AND (author = ? OR ? IS NULL AND author" & _
        " IS NULL) AND (description = ? OR ? IS NULL AND description IS NULL) AND (link =" & _
        " ? OR ? IS NULL AND link IS NULL) AND (pubdate = ? OR ? IS NULL AND pubdate IS N" & _
        "ULL) AND (title = ? OR ? IS NULL AND title IS NULL)"
        Me.OleDbUpdateCommand2.Connection = Me.OleDbConnection1
        Me.OleDbUpdateCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("author", System.Data.OleDb.OleDbType.VarWChar, 50, "author"))
        Me.OleDbUpdateCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("description", System.Data.OleDb.OleDbType.VarWChar, 250, "description"))
        Me.OleDbUpdateCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("link", System.Data.OleDb.OleDbType.VarWChar, 250, "link"))
        Me.OleDbUpdateCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("pubdate", System.Data.OleDb.OleDbType.DBDate, 0, "pubdate"))
        Me.OleDbUpdateCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("title", System.Data.OleDb.OleDbType.VarWChar, 250, "title"))
        Me.OleDbUpdateCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("View", System.Data.OleDb.OleDbType.Boolean, 2, "View"))
        Me.OleDbUpdateCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_id", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "id", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_View", System.Data.OleDb.OleDbType.Boolean, 2, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "View", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_author", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "author", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_author1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "author", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_description", System.Data.OleDb.OleDbType.VarWChar, 250, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "description", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_description1", System.Data.OleDb.OleDbType.VarWChar, 250, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "description", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_link", System.Data.OleDb.OleDbType.VarWChar, 250, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "link", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_link1", System.Data.OleDb.OleDbType.VarWChar, 250, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "link", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_pubdate", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "pubdate", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_pubdate1", System.Data.OleDb.OleDbType.DBDate, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "pubdate", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_title", System.Data.OleDb.OleDbType.VarWChar, 250, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "title", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand2.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_title1", System.Data.OleDb.OleDbType.VarWChar, 250, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "title", System.Data.DataRowVersion.Original, Nothing))
        '
        'dgdItems
        '
        Me.dgdItems.AllowSorting = CType(configurationAppSettings.GetValue("DataGrid2.AllowSorting", GetType(System.Boolean)), Boolean)
        Me.dgdItems.DataMember = "item"
        Me.dgdItems.DataSource = Me.DataSet11
        Me.dgdItems.HeaderForeColor = System.Drawing.SystemColors.ControlText
        Me.dgdItems.Location = New System.Drawing.Point(496, 16)
        Me.dgdItems.Name = "dgdItems"
        Me.dgdItems.Size = New System.Drawing.Size(680, 312)
        Me.dgdItems.TabIndex = 5
        Me.dgdItems.TableStyles.AddRange(New System.Windows.Forms.DataGridTableStyle() {Me.dgdtabstyleItems})
        Me.tooltipMain.SetToolTip(Me.dgdItems, "Table of Selected News Items.  Click column title to sort on column")
        '
        'dgdtabstyleItems
        '
        Me.dgdtabstyleItems.DataGrid = Me.dgdItems
        Me.dgdtabstyleItems.GridColumnStyles.AddRange(New System.Windows.Forms.DataGridColumnStyle() {Me.dgdboolcolView, Me.dgdtextcolTitle, Me.dgdtextcolDescription})
        Me.dgdtabstyleItems.HeaderForeColor = System.Drawing.SystemColors.ControlText
        Me.dgdtabstyleItems.MappingName = "item"
        '
        'dgdboolcolView
        '
        Me.dgdboolcolView.AllowNull = False
        Me.dgdboolcolView.FalseValue = False
        Me.dgdboolcolView.HeaderText = "View"
        Me.dgdboolcolView.MappingName = "View"
        Me.dgdboolcolView.NullValue = CType(resources.GetObject("dgdboolcolView.NullValue"), Object)
        Me.dgdboolcolView.TrueValue = True
        Me.dgdboolcolView.Width = 50
        '
        'dgdtextcolTitle
        '
        Me.dgdtextcolTitle.Format = ""
        Me.dgdtextcolTitle.FormatInfo = Nothing
        Me.dgdtextcolTitle.HeaderText = "Title"
        Me.dgdtextcolTitle.MappingName = "title"
        Me.dgdtextcolTitle.ReadOnly = True
        Me.dgdtextcolTitle.Width = 250
        '
        'dgdtextcolDescription
        '
        Me.dgdtextcolDescription.Format = ""
        Me.dgdtextcolDescription.FormatInfo = Nothing
        Me.dgdtextcolDescription.HeaderText = "Description"
        Me.dgdtextcolDescription.MappingName = "description"
        Me.dgdtextcolDescription.ReadOnly = True
        Me.dgdtextcolDescription.Width = 250
        '
        'webBrowser0
        '
        Me.webBrowser0.Enabled = True
        Me.webBrowser0.Location = New System.Drawing.Point(8, 376)
        Me.webBrowser0.OcxState = CType(resources.GetObject("webBrowser0.OcxState"), System.Windows.Forms.AxHost.State)
        Me.webBrowser0.Size = New System.Drawing.Size(1168, 440)
        Me.webBrowser0.TabIndex = 10
        '
        'btnNext
        '
        Me.btnNext.Location = New System.Drawing.Point(120, 336)
        Me.btnNext.Name = "btnNext"
        Me.btnNext.Size = New System.Drawing.Size(104, 24)
        Me.btnNext.TabIndex = 11
        Me.btnNext.Text = "Next"
        Me.tooltipMain.SetToolTip(Me.btnNext, "Next Selected News Item")
        '
        'btnPrevious
        '
        Me.btnPrevious.Location = New System.Drawing.Point(16, 336)
        Me.btnPrevious.Name = "btnPrevious"
        Me.btnPrevious.Size = New System.Drawing.Size(96, 23)
        Me.btnPrevious.TabIndex = 12
        Me.btnPrevious.Text = "Previous"
        Me.tooltipMain.SetToolTip(Me.btnPrevious, "Previous Selected News Item")
        '
        'lblPosition
        '
        Me.lblPosition.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
        Me.lblPosition.Location = New System.Drawing.Point(232, 336)
        Me.lblPosition.Name = "lblPosition"
        Me.lblPosition.Size = New System.Drawing.Size(560, 24)
        Me.lblPosition.TabIndex = 13
        Me.tooltipMain.SetToolTip(Me.lblPosition, "URL of News Item")
        '
        'OleDbdaViewItems
        '
        Me.OleDbdaViewItems.InsertCommand = Me.OleDbInsertCommand3
        Me.OleDbdaViewItems.SelectCommand = Me.OleDbSelectCommand3
        Me.OleDbdaViewItems.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "ViewItems", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("link", "link")})})
        '
        'OleDbInsertCommand3
        '
        Me.OleDbInsertCommand3.CommandText = "INSERT INTO ViewItems(link) VALUES (?)"
        Me.OleDbInsertCommand3.Connection = Me.OleDbConnection1
        Me.OleDbInsertCommand3.Parameters.Add(New System.Data.OleDb.OleDbParameter("link", System.Data.OleDb.OleDbType.VarWChar, 250, "link"))
        '
        'OleDbSelectCommand3
        '
        Me.OleDbSelectCommand3.CommandText = "SELECT link FROM ViewItems"
        Me.OleDbSelectCommand3.Connection = Me.OleDbConnection1
        '
        'pgsBrowser
        '
        Me.pgsBrowser.Location = New System.Drawing.Point(800, 336)
        Me.pgsBrowser.Name = "pgsBrowser"
        Me.pgsBrowser.Size = New System.Drawing.Size(376, 24)
        Me.pgsBrowser.TabIndex = 16
        '
        'mnuMainMenu
        '
        Me.mnuMainMenu.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem1, Me.MenuItem6, Me.MenuItem11, Me.MenuItem4})
        '
        'MenuItem1
        '
        Me.MenuItem1.Index = 0
        Me.MenuItem1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuGetFeeds, Me.MenuItem5, Me.mnuSelectAllFeeds, Me.mnuClearSiteSelections, Me.MenuItem3, Me.mnuAddSite})
        Me.MenuItem1.Text = "RSS Sites"
        '
        'mnuGetFeeds
        '
        Me.mnuGetFeeds.Index = 0
        Me.mnuGetFeeds.Text = "Get List of Items from Selected Sites "
        '
        'MenuItem5
        '
        Me.MenuItem5.Index = 1
        Me.MenuItem5.Text = "-"
        '
        'mnuSelectAllFeeds
        '
        Me.mnuSelectAllFeeds.Index = 2
        Me.mnuSelectAllFeeds.Text = "Select All Sites"
        '
        'mnuClearSiteSelections
        '
        Me.mnuClearSiteSelections.Index = 3
        Me.mnuClearSiteSelections.Text = "Clear Site Selections"
        '
        'MenuItem3
        '
        Me.MenuItem3.Index = 4
        Me.MenuItem3.Text = "-"
        '
        'mnuAddSite
        '
        Me.mnuAddSite.Enabled = False
        Me.mnuAddSite.Index = 5
        Me.mnuAddSite.Text = "Add RSS Site to Database"
        '
        'MenuItem6
        '
        Me.MenuItem6.Index = 1
        Me.MenuItem6.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuGetSelectedItems, Me.MenuItem8, Me.mnuSelectAllItems, Me.mnuClearItemSelections, Me.MenuItem2, Me.mnuDeleteItemsNotSelected, Me.mnuDeleteAllItems})
        Me.MenuItem6.Text = "News Items"
        '
        'mnuGetSelectedItems
        '
        Me.mnuGetSelectedItems.Index = 0
        Me.mnuGetSelectedItems.Text = "Get Selected News Items"
        '
        'MenuItem8
        '
        Me.MenuItem8.Index = 1
        Me.MenuItem8.Text = "-"
        '
        'mnuSelectAllItems
        '
        Me.mnuSelectAllItems.Index = 2
        Me.mnuSelectAllItems.Text = "Select All Items"
        '
        'mnuClearItemSelections
        '
        Me.mnuClearItemSelections.Index = 3
        Me.mnuClearItemSelections.Text = "Clear Item Selections"
        '
        'MenuItem2
        '
        Me.MenuItem2.Index = 4
        Me.MenuItem2.Text = "-"
        '
        'mnuDeleteItemsNotSelected
        '
        Me.mnuDeleteItemsNotSelected.Index = 5
        Me.mnuDeleteItemsNotSelected.Text = "Delete Items Not Selected"
        '
        'mnuDeleteAllItems
        '
        Me.mnuDeleteAllItems.Index = 6
        Me.mnuDeleteAllItems.Text = "Delete All Items"
        '
        'MenuItem11
        '
        Me.MenuItem11.Index = 2
        Me.MenuItem11.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuBrowserNextPage, Me.mnuBrowserPreviousPage})
        Me.MenuItem11.Text = "Browser"
        '
        'mnuBrowserNextPage
        '
        Me.mnuBrowserNextPage.Index = 0
        Me.mnuBrowserNextPage.Shortcut = System.Windows.Forms.Shortcut.F12
        Me.mnuBrowserNextPage.Text = "Next Page"
        '
        'mnuBrowserPreviousPage
        '
        Me.mnuBrowserPreviousPage.Index = 1
        Me.mnuBrowserPreviousPage.Shortcut = System.Windows.Forms.Shortcut.F11
        Me.mnuBrowserPreviousPage.Text = "Previous Page"
        '
        'MenuItem4
        '
        Me.MenuItem4.Index = 3
        Me.MenuItem4.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuWebHelp, Me.mnuAbout})
        Me.MenuItem4.Text = "Help"
        '
        'mnuWebHelp
        '
        Me.mnuWebHelp.Index = 0
        Me.mnuWebHelp.Text = "Web Help"
        '
        'mnuAbout
        '
        Me.mnuAbout.Index = 1
        Me.mnuAbout.Text = "About"
        '
        'dgdSites
        '
        Me.dgdSites.AllowSorting = CType(configurationAppSettings.GetValue("dgdSites.AllowSorting", GetType(System.Boolean)), Boolean)
        Me.dgdSites.DataMember = "rsssites"
        Me.dgdSites.DataSource = Me.DataSet11
        Me.dgdSites.HeaderForeColor = System.Drawing.SystemColors.ControlText
        Me.dgdSites.Location = New System.Drawing.Point(8, 16)
        Me.dgdSites.Name = "dgdSites"
        Me.dgdSites.Size = New System.Drawing.Size(480, 312)
        Me.dgdSites.TabIndex = 17
        Me.dgdSites.TableStyles.AddRange(New System.Windows.Forms.DataGridTableStyle() {Me.dgdtsSites})
        Me.tooltipMain.SetToolTip(Me.dgdSites, "Table of RSS Sites.  Click column title to sort on column")
        '
        'dgdtsSites
        '
        Me.dgdtsSites.DataGrid = Me.dgdSites
        Me.dgdtsSites.GridColumnStyles.AddRange(New System.Windows.Forms.DataGridColumnStyle() {Me.dgdboolcolViewSite, Me.dgdtextcolSiteName, Me.dgdtextcolDesc})
        Me.dgdtsSites.HeaderForeColor = System.Drawing.SystemColors.ControlText
        Me.dgdtsSites.MappingName = "rsssites"
        '
        'dgdboolcolViewSite
        '
        Me.dgdboolcolViewSite.AllowNull = False
        Me.dgdboolcolViewSite.FalseValue = False
        Me.dgdboolcolViewSite.HeaderText = "View"
        Me.dgdboolcolViewSite.MappingName = "View"
        Me.dgdboolcolViewSite.NullValue = CType(resources.GetObject("dgdboolcolViewSite.NullValue"), Object)
        Me.dgdboolcolViewSite.TrueValue = True
        Me.dgdboolcolViewSite.Width = 60
        '
        'dgdtextcolSiteName
        '
        Me.dgdtextcolSiteName.Format = "150"
        Me.dgdtextcolSiteName.FormatInfo = Nothing
        Me.dgdtextcolSiteName.HeaderText = "Site Name"
        Me.dgdtextcolSiteName.MappingName = "SiteName"
        Me.dgdtextcolSiteName.ReadOnly = True
        Me.dgdtextcolSiteName.Width = 200
        '
        'dgdtextcolDesc
        '
        Me.dgdtextcolDesc.Format = ""
        Me.dgdtextcolDesc.FormatInfo = Nothing
        Me.dgdtextcolDesc.HeaderText = "Description"
        Me.dgdtextcolDesc.MappingName = "Description"
        Me.dgdtextcolDesc.ReadOnly = True
        Me.dgdtextcolDesc.Width = 150
        '
        'tooltipMain
        '
        Me.tooltipMain.AutomaticDelay = 100
        '
        'OleDbdaSites
        '
        Me.OleDbdaSites.DeleteCommand = Me.OleDbDeleteCommand1
        Me.OleDbdaSites.InsertCommand = Me.OleDbInsertCommand1
        Me.OleDbdaSites.SelectCommand = Me.OleDbSelectCommand1
        Me.OleDbdaSites.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "rsssites", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("id", "id"), New System.Data.Common.DataColumnMapping("SiteName", "SiteName"), New System.Data.Common.DataColumnMapping("View", "View"), New System.Data.Common.DataColumnMapping("XMLURL", "XMLURL"), New System.Data.Common.DataColumnMapping("Description", "Description")})})
        Me.OleDbdaSites.UpdateCommand = Me.OleDbUpdateCommand1
        '
        'OleDbDeleteCommand1
        '
        Me.OleDbDeleteCommand1.CommandText = "DELETE FROM rsssites WHERE (id = ?) AND (Description = ? OR ? IS NULL AND Descrip" & _
        "tion IS NULL) AND (SiteName = ? OR ? IS NULL AND SiteName IS NULL) AND ([View] =" & _
        " ?) AND (XMLURL = ? OR ? IS NULL AND XMLURL IS NULL)"
        Me.OleDbDeleteCommand1.Connection = Me.OleDbConnection1
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_id", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "id", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Description", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Description", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Description1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Description", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_SiteName", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "SiteName", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_SiteName1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "SiteName", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_View", System.Data.OleDb.OleDbType.Boolean, 2, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "View", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_XMLURL", System.Data.OleDb.OleDbType.VarWChar, 200, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "XMLURL", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbDeleteCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_XMLURL1", System.Data.OleDb.OleDbType.VarWChar, 200, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "XMLURL", System.Data.DataRowVersion.Original, Nothing))
        '
        'OleDbInsertCommand1
        '
        Me.OleDbInsertCommand1.CommandText = "INSERT INTO rsssites(SiteName, [View], XMLURL, Description) VALUES (?, ?, ?, ?)"
        Me.OleDbInsertCommand1.Connection = Me.OleDbConnection1
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("SiteName", System.Data.OleDb.OleDbType.VarWChar, 50, "SiteName"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("View", System.Data.OleDb.OleDbType.Boolean, 2, "View"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("XMLURL", System.Data.OleDb.OleDbType.VarWChar, 200, "XMLURL"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Description", System.Data.OleDb.OleDbType.VarWChar, 50, "Description"))
        '
        'OleDbSelectCommand1
        '
        Me.OleDbSelectCommand1.CommandText = "SELECT id, SiteName, [View], XMLURL, Description FROM rsssites"
        Me.OleDbSelectCommand1.Connection = Me.OleDbConnection1
        '
        'OleDbUpdateCommand1
        '
        Me.OleDbUpdateCommand1.CommandText = "UPDATE rsssites SET SiteName = ?, [View] = ?, XMLURL = ?, Description = ? WHERE (" & _
        "id = ?) AND (Description = ? OR ? IS NULL AND Description IS NULL) AND (SiteName" & _
        " = ? OR ? IS NULL AND SiteName IS NULL) AND ([View] = ?) AND (XMLURL = ? OR ? IS" & _
        " NULL AND XMLURL IS NULL)"
        Me.OleDbUpdateCommand1.Connection = Me.OleDbConnection1
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("SiteName", System.Data.OleDb.OleDbType.VarWChar, 50, "SiteName"))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("View", System.Data.OleDb.OleDbType.Boolean, 2, "View"))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("XMLURL", System.Data.OleDb.OleDbType.VarWChar, 200, "XMLURL"))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Description", System.Data.OleDb.OleDbType.VarWChar, 50, "Description"))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_id", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "id", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Description", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Description", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Description1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Description", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_SiteName", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "SiteName", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_SiteName1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "SiteName", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_View", System.Data.OleDb.OleDbType.Boolean, 2, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "View", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_XMLURL", System.Data.OleDb.OleDbType.VarWChar, 200, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "XMLURL", System.Data.DataRowVersion.Original, Nothing))
        Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_XMLURL1", System.Data.OleDb.OleDbType.VarWChar, 200, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "XMLURL", System.Data.DataRowVersion.Original, Nothing))
        '
        'frmMainForm
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(1248, 841)
        Me.Controls.Add(Me.dgdSites)
        Me.Controls.Add(Me.pgsBrowser)
        Me.Controls.Add(Me.lblPosition)
        Me.Controls.Add(Me.btnPrevious)
        Me.Controls.Add(Me.btnNext)
        Me.Controls.Add(Me.webBrowser0)
        Me.Controls.Add(Me.dgdItems)
        Me.KeyPreview = True
        Me.Menu = Me.mnuMainMenu
        Me.Name = "frmMainForm"
        Me.Text = "RSS News Reader"
        CType(Me.DataSet11, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.dgdItems, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.webBrowser0, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.dgdSites, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub frmMainForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ' get site names and url's from rsssites table in database
        Me.OleDbdaSites.Fill(Me.DataSet11.rsssites)
    End Sub


    Private Sub procClearSelectedSites()
        Dim i As Integer, j As Integer
        ' get number of news items in database table, rsssites
        i = Me.DataSet11.rsssites.Rows.Count
        ' do only there is at least one site
        If 1 >= 1 Then
            ' loop from row index 0 to i-1
            For j = 0 To i - 1
                Dim dr As DataRow
                ' for each row, set the View field value to false
                ' Note: This can be also be handled with a SQL statement and a command
                dr = Me.DataSet11.rsssites.Rows(j)
                dr.Item("View") = False
            Next
        End If
    End Sub
    Private Sub procClearSelectedItems()
        Dim i As Integer, j As Integer
        ' get number of news items in database table, item
        i = Me.DataSet11.item.Rows.Count
        ' do only there is at least one item
        If 1 >= 1 Then
            ' loop from row index 0 to i-1
            For j = 0 To i - 1
                Dim dr As DataRow
                ' for each row, set the View field value to false
                ' Note: This can be also be handled with a SQL statement and a command
                dr = Me.DataSet11.item.Rows(j)
                dr.Item("View") = False
            Next
        End If
    End Sub


    Private Sub frmMainForm_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed
        ' save view items in database when form is closed
        ' items will be available the next time the app is loaded
        Me.OleDbdaItem.Update(Me.DataSet11.item)
        'make sure the database connection is closed
        If Me.OleDbConnection1.State <> ConnectionState.Closed Then
            Me.OleDbConnection1.Close()
        End If
    End Sub


    Private Sub GetNewsFeeds()
        ' Update database to make sure sites selected are stored in database
        Me.OleDbdaSites.Update(Me.DataSet11.rsssites)
        Dim i As Integer, j As Integer
        i = Me.DataSet11.rsssites.Rows.Count
        If i >= 1 Then
            ' Loop from first (index 0) to i-1th (last) item in the rss sites table
            For j = 0 To i - 1
                Dim dr As DataRow
                Dim strUrl As String, intSiteID As Integer
                dr = Me.DataSet11.rsssites.Rows(j)
                ' select only sites with view checkbox selected by user.
                If dr.Item("View") = True Then
                    strUrl = dr.Item("XMLURL").ToString
                    intSiteID = Val(dr.Item("id").ToString)
                    ' call procedure to read URL and get RSS Item feed
                    GetNewsFeedItemsFromSite(strUrl, intSiteID)
                End If
            Next
        End If
        ' Refresh the item dataset with the updated data from the item table
        Me.OleDbdaItem.Fill(Me.DataSet11.item)
        ' Display the items dataset in the datagrid
        Me.dgdItems.Refresh()
      
    End Sub

    Private Sub GetNewsFeedItemsFromSite(ByVal strURL As String, ByVal intSiteID As Integer)
        Dim intRowsAffected As Integer
        On Error GoTo errsub
        Dim ds As New DataSet
        ds.ReadXml(strURL)
        ' The RSS feed is XML data that is read into tables in the 
        ' dataset.
        ' The table names are rss, channel, image, item, and guid
        ' The rss table has a column named version; value of 2.0 for Rss2.0
        ' The channel table has columns named 
        '      title, link, description, copyright, language and lastBuildDate)
        ' This is the channel's decription
        ' en-us is US english for language
        ' The image table has columns named url, title, link
        ' The item table has columns named title, link, description,author, pubDate 
        '      for each item in the channel
        ' The guid table has columns named isPermaLink  and guid_Text
        Dim intCount As Integer, intRow As Integer
        Dim strTitle As String, strDescription As String
        Dim strItemURL As String
        ' get number of rows in item table from XML page dataset
        intCount = ds.Tables("Item").Rows.Count
        ' you have data to add to the item table in the database only if there is at least one row
        If intCount > 0 Then
            ' loop through rows in the item table in the XML page dataset
            For intRow = 0 To intCount - 1
                'Get values from dataset
                ' Replace apostrophe with double apostrophe for Access text fields
                ' Limit string length for Access database text field.  This can be longer if
                ' you use Oracle, DB2, or SQL Server
                strItemURL = ds.Tables("Item").Rows(intRow).Item("link").ToString
                strItemURL = SQLString(strItemURL, 250)

                strTitle = ds.Tables("Item").Rows(intRow).Item("title").ToString
                strTitle = SQLString(strTitle, 100)

                strDescription = ds.Tables("Item").Rows(intRow).Item("description").ToString
                strDescription = SQLString(strDescription, 250)

                Dim MyCommand As New OleDb.OleDbCommand
                ' Insert news feed items from selected RSS sites into items table
                ' Other fields like author and data of publication can also be added here
                MyCommand.CommandText = "Insert into Item (title,link,description,siteid) VALUES " & _
                "('" & strTitle & "','" & strItemURL & "','" & strDescription & "'," & intSiteID & ")"
                If Me.OleDbConnection1.State <> ConnectionState.Open Then
                    Me.OleDbConnection1.Open()
                End If
                MyCommand.Connection = Me.OleDbConnection1
                intRowsAffected = MyCommand.ExecuteNonQuery()
                MyCommand.Dispose()
                '  MsgBox("insert done" & intRowsAffected.ToString & " rows", MsgBoxStyle.Information, "Message")
            Next
            '   MsgBox("done with items", MsgBoxStyle.Information, "Message")
        Else
            MsgBox("No sites selected; No news items", MsgBoxStyle.Information, "Message")
        End If
        Exit Sub
errsub:
        MsgBox(Err.Description, MsgBoxStyle.Critical, "Error")
    End Sub
    Private Sub GetFeed(ByVal i As Integer)
        On Error GoTo ErrSub
        Dim strUrl As String
        Dim dr As DataRow
        'Select the row (base 0) from the viewitems dataset
        dr = Me.DataSet11.ViewItems.Rows(i - 1)
        strUrl = dr.Item("link").ToString
        'Navigate to the site and display in browser
        webBrowser0.Navigate(strUrl)
        'Item being displayed in browser
        Me.lblPosition.Text = intItemViewed.ToString & " of " & intItemstoView.ToString & " items.  " & webBrowser0.LocationURL.ToString
        Exit Sub
ErrSub:
        MsgBox(Err.Description & " in GetFeed Procedure.  ", MsgBoxStyle.Information, "Error")
    End Sub
    Private Sub btnNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNext.Click
        procNextPage()
    End Sub
    Private Sub procNextPage()
        ' If the page being viewed is not the last page, view next page
        If intItemViewed < intItemstoView Then
            intItemViewed = intItemViewed + 1
            GetFeed(intItemViewed)
            pgsBrowser.Value = intItemViewed
        Else
            MsgBox("Last Item Displayed", MsgBoxStyle.Information, "Error")
        End If
    End Sub
    Private Sub procPreviousPage()
        'If the page being viewed is not the first page then view the previous page
        If intItemViewed > 1 Then
            intItemViewed = intItemViewed - 1
            GetFeed(intItemViewed)
            pgsBrowser.Value = intItemViewed
        Else
            MsgBox("First Item Displayed", MsgBoxStyle.Information, "Error")
        End If
    End Sub
    Private Sub btnPrevious_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrevious.Click
        procPreviousPage()
    End Sub



    Private Sub mnuGetFeeds_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuGetFeeds.Click
        GetNewsFeeds()
    End Sub

    Private Sub mnuSelectAllFeeds_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuSelectAllFeeds.Click
        Dim i As Integer, j As Integer
        ' get number of rss sites in database table, rsssites
        i = Me.DataSet11.rsssites.Rows.Count
        ' do this loop only if there is at least one site
        If 1 >= 1 Then
            ' loop from row index 0 to i-1
            For j = 0 To i - 1
                ' for each row, set the View field value to true
                ' Note: This can be also be handled with a SQL statement and a command
                Dim dr As DataRow
                dr = Me.DataSet11.rsssites.Rows(j)
                dr.Item("View") = True
            Next
        Else
            MsgBox("No sites in the list.  No feeds found", MsgBoxStyle.Information, "Error")
        End If
    End Sub



    Private Sub mnuGetSelectedItems_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuGetSelectedItems.Click
        Dim i As Integer, j As Integer, strURL As String, boolView As Boolean
        ' Run only if there is at least one item in the Items table
        i = Me.DataSet11.item.Rows.Count
        intItemstoView = 0
        If i >= 1 Then
            ' save view items in database
            Me.OleDbdaItem.Update(Me.DataSet11.item)
            ' update dataset to get news items to be viewed
            'ViewITems is a query in the Access database selecting the items that have a View value set to True
            Me.OleDbdaViewItems.Fill(Me.DataSet11.ViewItems)
            intItemstoView = Me.DataSet11.ViewItems.Rows.Count
            ' Set range values for progress bar
            pgsBrowser.Maximum = intItemstoView
            pgsBrowser.Minimum = 0
            If intItemstoView >= 1 Then
                intItemViewed = 1
                GetFeed(intItemViewed)
            Else
                MsgBox("No Items selected to be viewed.", MsgBoxStyle.Information, "Message")
            End If
        Else
            MsgBox("Get feeds to add to items; Menu Item RSS Sites, Get Feeds", MsgBoxStyle.Information, "Message")
        End If

    End Sub

    Private Sub mnuSelectAllItems_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuSelectAllItems.Click
        Dim i As Integer, j As Integer
        i = Me.DataSet11.item.Rows.Count
        ' If there are items in the itme dataset then set value of View in all items to True
        ' This can be done with a SQL command.
        If 1 >= 1 Then
            For j = 0 To i - 1
                Dim dr As DataRow
                dr = Me.DataSet11.item.Rows(j)
                dr.Item("View") = True
            Next
            ' save view items in database
            Me.OleDbdaItem.Update(Me.DataSet11.item)
        End If
    End Sub



    Private Sub mnuDeleteItemsNotSelected_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuDeleteItemsNotSelected.Click
        Dim MsgResult As DialogResult, intRowsAffected As Integer
        ' Warning message before deleting items from the database
        MsgResult = MessageBox.Show("Items NOT selected will be deleted from the database.  Do you want to proceed?", "Data Base Deletion", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning)
        'Proceed only after user confirmation
        If MsgResult = DialogResult.Yes Then
            ' save view item state in database
            'This saves the current state of the items table, and records user selections before deleting
            ' items not selected for viewing
            'If this is not done, then the delete command will remove items selected for viewing as well
            Me.OleDbdaItem.Update(Me.DataSet11.item)
            Dim MyCommand As New OleDb.OleDbCommand
            MyCommand.CommandText = "Delete from Item where view = False"
            If Me.OleDbConnection1.State <> ConnectionState.Open Then
                Me.OleDbConnection1.Open()
            End If
            MyCommand.Connection = Me.OleDbConnection1
            intRowsAffected = MyCommand.ExecuteNonQuery()
            MyCommand.Dispose()
            'Clear dataset and fill it with new, updated item table from database
            Me.DataSet11.item.Clear()
            Me.OleDbdaItem.Fill(Me.DataSet11.item)
            Me.dgdItems.Refresh()
        End If

    End Sub

    Private Sub mnuDeleteAllItems_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuDeleteAllItems.Click
        Dim MsgResult As DialogResult, intRows As Integer, i As Integer
        MsgResult = MessageBox.Show("All Items will be deleted from the database.  Do you want to proceed?", "Data Base Deletion", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning)
        'Verify user decision before deleting items in database table
        If MsgResult = DialogResult.Yes Then
            intRows = Me.DataSet11.item.Rows.Count
            For i = 0 To intRows - 1
                Me.DataSet11.item.Rows(i).Delete()
            Next i
        End If
        Me.OleDbdaItem.Update(Me.DataSet11.item)
    End Sub

    Private Sub mnuClearItemSelections_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuClearItemSelections.Click
        procClearSelectedItems()
        Me.OleDbdaItem.Update(Me.DataSet11.item)
    End Sub

    Private Sub mnuBrowserNextPage_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuBrowserNextPage.Click
        procNextPage()
    End Sub

    Private Sub mnuBrowserPreviousPage_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuBrowserPreviousPage.Click
        procPreviousPage()
    End Sub

    Private Sub mnuClearSiteSelections_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuClearSiteSelections.Click
        procClearSelectedSites()
        ' save site selection data back to database
        Me.OleDbdaSites.Update(Me.DataSet11.rsssites)
    End Sub


    Private Sub mnuAddSite_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuAddSite.Click
        ' Code to be added later to open another form to edit the rssSites table.
    End Sub


    Private Sub mnuAbout_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuAbout.Click
        Dim asmbly As System.Reflection.Assembly
        Dim copyright As System.Reflection.AssemblyCopyrightAttribute
        asmbly = System.Reflection.Assembly.GetExecutingAssembly
        copyright = asmbly.GetCustomAttributes(GetType(System.Reflection.AssemblyCopyrightAttribute), False)(0)

        MsgBox("Product: " & Application.ProductName & vbCrLf & "Version: " & Application.ProductVersion.ToString & vbCrLf & "Copyright:  " & copyright.Copyright.ToString, MsgBoxStyle.Information, "About")

    End Sub

    Private Sub mnuWebHelp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuWebHelp.Click
        ' Help on web site 
        webBrowser0.Navigate("http://mang.uno.edu/RssReader")
    End Sub

    Private Function SQLString(ByVal strSQL As String, ByVal intLength As Integer) As String
        strSQL = Replace(strSQL, "'", "''")
        If strSQL.Length > intLength Then
            strSQL = strSQL.Substring(0, intLength)
        End If
        Return strSQL
    End Function


End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

SathiMahesh

United States United States
I am a Professor at the University of New Orleans.
 
My interests include business applications development, e-business, and cybersociety
 


| Advertise | Privacy | Mobile
Web04 | 2.8.141022.2 | Last Updated 11 May 2005
Article Copyright 2005 by SathiMahesh
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid