473,321 Members | 1,667 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

XMLTextReader is not defined

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
---------------------------------------------------------------------------------------------------------
Nov 19 '05 #1
2 2063


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/
Nov 19 '05 #2
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
XM***********@discussions.microsoft.com> wrote in message
news:0E**********************************@microsof t.com...
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
--------------------------------------------------------------------------

-------------------------------
Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Andy Neilson | last post by:
I've run across a strange behaviour with XmlSerializer that I'm unable to explain. I came across this while trying to use XmlSerializer to deserialize from a the details of a SoapException. This...
5
by: Geoff Bennett | last post by:
While parsing an XML document, my TextReader instance skips nodes. For example, in this fragment: <Person Sex="Male" FirstHomeBuyer="No" YearsInCurrentProfession="14"> <RelatedEntityRef...
2
by: Yuriy | last post by:
Hi, any ideas how to read XML fragment from TextReader? XmlTextReader constructor accepts only Stream or string as source Do I miss something? thanks Yuriy
1
by: RJN | last post by:
Hi I'm using XMLTextReader to parse the contents of XML. I have issues when the xml content itself has some special characters like & ,> etc. <CompanyName>Johnson & Jhonson</CompanyName>...
1
by: SHC | last post by:
Hi all, I did the "Build" on the attached code in my VC++ .NET 2003 - Windows XP Pro PC. On the c:\ screen, I got the following: Microsoft Development Environment An unhandled exception of type...
3
by: Kjeld | last post by:
My scenario: I'm using an XmlTextReader to Deserialize serveral classes from a single xml document. Every class i pass the source stream, containing the xml. Each class subsequently creates an...
2
by: Q | last post by:
I am feeding XmlTextReader a URL that returns the XML that then gets parsed. The URL forms a query that affects how much data is returned in XML but not the format of the data. The problem is...
4
by: CodeRazor | last post by:
I am reading an xml file from a URL. I was originally doing this using the XmlDocument class. But this was very slow. The XmlTextReader is meant to be much quicker for forward only retrieval of...
4
by: CodeRazor | last post by:
I am trying to use an XmlTextReader to retrieve data. I need to use an XmlTextReader because it is faster than using an XmlDocument. I have found an inelegant way of retrieving each item's title...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.