simple ? about xmltextwriter class...

Codeless

Well-known member
Joined
Jan 24, 2003
Messages
59
Location
Great NW
When I copy some of the examples of the xmltextwriter class into my code I get the little squiggly lines under things like XmlConvert, XmlWriter, and XmlTextWriter and it tells me that they are not defined even though I have imported system.xml. Any idea what I might be missing?

Looks like this:
Code:
Imports System.IO
Imports System.Xml

    Shared Sub WriteQuote(ByVal writer As XmlWriter, ByVal symbol As String, ByVal price As Double, ByVal change As Double, ByVal volume As Long)
        writer.WriteStartElement("Stock")
        writer.WriteAttributeString("Symbol", symbol)
        writer.WriteElementString("Price", XmlConvert.ToString(price))
        writer.WriteElementString("Change", XmlConvert.ToString(change))
        writer.WriteElementString("Volume", XmlConvert.ToString(volume))
        writer.WriteEndElement()
    End Sub WriteQuote

    Public Shared Sub Main()
        Dim writer As New XmlTextWriter(Console.Out)
        writer.Formatting = Formatting.Indented
        WriteQuote(writer, "MSFT", 74.125, 5.89, 69020000)
        writer.Close()
    End Sub Main

see I knew it would be simple.
 
Nevermind. I guess a new Web Project doesnt create a default reference to system.xml like Windows Projects do.
 
Back
Top