XMLTextReader is not defined

G

Guest

im trying to read an xml file which is in the wwwroot folder.im using IIS on
XP Prof.
my code is
--------------------------------------------------------------------------------------------------------
<%@ Page Language="VB" Debug="true" codePage="28599" %>
<script runat="server">
Sub Page_Load(Sender as Object,E As EventArgs)
dim okuyucu as XMLTextReader
okuyucu=new XMLTextReader(Server.MapPath("comments.xml"))

while okuyucu.Read()
Response.Write("<b>" & okuyucu.Name & "</b>" & okuyucu.Value & "<br>")
End While


okuyucu.close
End Sub
</script>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html"; charset=iso-8859-9">
</head>
<body>
</body>
</html
---------------------------------------------------------------------------------------------------------
but i get the following error message,why?
---------------------------------------------------------------------------------------------------------
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.

Compiler Error Message: BC30002: Type 'XMLTextReader' is not defined.

Source Error:



Line 2: <script runat="server">
Line 3: Sub Page_Load(Sender as Object,E As EventArgs)
Line 4: dim okuyucu as XMLTextReader
Line 5: okuyucu=new XMLTextReader(Server.MapPath("comments.xml"))
Line 6:


Source File: c:\inetpub\wwwroot\XMLRead.aspx Line: 4
---------------------------------------------------------------------------------------------------------
 
M

Martin Honnen

XML said:
im trying to read an xml file which is in the wwwroot folder.im using IIS on
XP Prof.
my code is :

Try to add
<%@ Import Namespace="System.Xml" %>
here.
 
W

William F. Robertson, Jr.

Try adding System.Xml to you XMLTextReader declaration.

dim okuyucu as System.Xml.XmlTextReader
okuyucu = new System.Xml.XmlTextReader( .... )

bill

"XML reading with XMLTextReader" <XML reading with
(e-mail address removed)> wrote in message
im trying to read an xml file which is in the wwwroot folder.im using IIS on
XP Prof.
my code is :
-------------------------------------------------------------------------- ------------------------------
<%@ Page Language="VB" Debug="true" codePage="28599" %>
<script runat="server">
Sub Page_Load(Sender as Object,E As EventArgs)
dim okuyucu as XMLTextReader
okuyucu=new XMLTextReader(Server.MapPath("comments.xml"))

while okuyucu.Read()
Response.Write("<b>" & okuyucu.Name & "</b>" & okuyucu.Value & "<br>")
End While


okuyucu.close
End Sub
</script>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html"; charset=iso-8859-9">
</head>
<body>
</body>
</html>
-------------------------------------------------------------------------- -------------------------------
but i get the following error message,why? :
-------------------------------------------------------------------------- -------------------------------
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.

Compiler Error Message: BC30002: Type 'XMLTextReader' is not defined.

Source Error:



Line 2: <script runat="server">
Line 3: Sub Page_Load(Sender as Object,E As EventArgs)
Line 4: dim okuyucu as XMLTextReader
Line 5: okuyucu=new XMLTextReader(Server.MapPath("comments.xml"))
Line 6:


Source File: c:\inetpub\wwwroot\XMLRead.aspx Line: 4
--------------------------------------------------------------------------
-------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top