Wrox Programmer Forums
|
VB.NET General VB.NET discussions for issues that don't fall into other VB.NET forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 14th, 2003, 08:03 PM
Registered User
 
Join Date: Jul 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Reading XML using VB.NET

Hello,
Here's a line from my .xml <DocumentType>6</DocumentType>
I need to read the xml and get the value "6" to be outputted in a csv or text file. Then I want to read the "6" into a vbscript. How is vbscript and vb.net different? Thank you.

Here's code in VB.NET. It's not reading anything yet?

 Try
                Dim objTxtRd = New XmlTextReader(strFilePath)

                While (objTxtRd.Read())
                    If (objTxtRd.NodeType = XmlNodeType.Text) Then
                        If (objTxtRd.Name = "DocumentType") Then
                            ListBox1.Items.Add("document type ID is" & objTxtRd.Value & ".")
                        End If
                    End If
                End While
            Catch err As Exception
                errmsg = errmsg + "Error occurred while reading " & strFilePath & " " _
                ListBox1.Items.Add(errmsg)
            Finally
                If Not objTxtRd Is Nothing Then
                    objTxtRd.Close()
                End If
End Try

Thank you very much.
 
Old July 16th, 2003, 03:45 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Explaining how VB and VB.NET is different would take a book... In fact there are quite a few out there that exist :). In any case- what happens when you run this?


Hal Levy
Unemployed (Thanks GWB)
NOT a Wiley/Wrox Employee





Similar Threads
Thread Thread Starter Forum Replies Last Post
data reading from excel using VB.net fly2irfan VB Databases Basics 1 January 27th, 2008 02:35 AM
Reading a MS Word Document using VB.net pauljohns353 VB How-To 0 November 14th, 2006 06:26 AM
Reading Emails from outlook using VB.net g_vamsi_krish ASP.NET 1.0 and 1.1 Basics 0 August 2nd, 2006 04:19 AM
Reading MS WORD Document by VB.Net ocarroll General .NET 0 March 31st, 2006 02:17 AM
Reading XML in ASP.net brettdavis4 General .NET 1 August 22nd, 2004 08:13 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.