M
Mr.D
I'm trying to read a RSS feed.
It works somewhat OK on some feed, while it craches on others :-/
What am I doing wrong(besides from all)?
Am I looking for the wrong thing?
<code>
Dim dsPubs As New Data.DataSet
Dim xdcDOC As New Xml.XmlDocument
Dim i As Integer = -1
Dim tblItem As Integer = -1
Dim colTitle As Integer = -1
Dim colLink As Integer = -1
dsPubs.ReadXml(TreeView1.SelectedNode.Text)
For i = 0 To dsPubs.Tables.Count - 1
If dsPubs.Tables(i).TableName = "channel" Then tblItem = i
Next
If tblItem = -1 Then Exit Sub '// Not found!?
For i = 0 To dsPubs.Tables(tblItem).Columns.Count - 1
If dsPubs.Tables(1).Columns(i).Caption = "title" Then
colTitle = i
ElseIf dsPubs.Tables(1).Columns(i).Caption = "link" Then
colLink = i
End If
Next
MsgBox(colTitle & vbNewLine & colLink)
</code>
It works somewhat OK on some feed, while it craches on others :-/
What am I doing wrong(besides from all)?
Am I looking for the wrong thing?
<code>
Dim dsPubs As New Data.DataSet
Dim xdcDOC As New Xml.XmlDocument
Dim i As Integer = -1
Dim tblItem As Integer = -1
Dim colTitle As Integer = -1
Dim colLink As Integer = -1
dsPubs.ReadXml(TreeView1.SelectedNode.Text)
For i = 0 To dsPubs.Tables.Count - 1
If dsPubs.Tables(i).TableName = "channel" Then tblItem = i
Next
If tblItem = -1 Then Exit Sub '// Not found!?
For i = 0 To dsPubs.Tables(tblItem).Columns.Count - 1
If dsPubs.Tables(1).Columns(i).Caption = "title" Then
colTitle = i
ElseIf dsPubs.Tables(1).Columns(i).Caption = "link" Then
colLink = i
End If
Next
MsgBox(colTitle & vbNewLine & colLink)
</code>