Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > XMLTextReader is not defined

Reply
Thread Tools

XMLTextReader is not defined

 
 
=?Utf-8?B?WE1MIHJlYWRpbmcgd2l0aCBYTUxUZXh0UmVhZGVy?=
Guest
Posts: n/a
 
      01-26-2005
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
---------------------------------------------------------------------------------------------------------
 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      01-26-2005


XML reading with XMLTextReader wrote:

> 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" %>


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

--

Martin Honnen
http://JavaScript.FAQTs.com/
 
Reply With Quote
 
 
 
 
William F. Robertson, Jr.
Guest
Posts: n/a
 
      01-26-2005
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
http://www.velocityreviews.com/forums/(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
> --------------------------------------------------------------------------

-------------------------------


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XmlTextReader not able to find DTD file Eivind Gussiås Løkseth ASP .Net 1 07-23-2008 11:58 AM
How to read HTML with XmlTextReader? Amil ASP .Net 2 02-06-2006 04:15 AM
#if (defined(__STDC__) && !defined(NO_PROTOTYPE)) || defined(__cplusplus) Oodini C Programming 1 09-27-2005 07:58 PM
XMLTextReader Simon Harris ASP .Net 2 05-11-2005 09:18 PM
XmlTextReader DotNet ASP .Net 1 02-06-2004 06:44 PM



Advertisments