XML Data Access Error with ASP.NET & Visual Studio .NET

Posted on 2005-05-13
Last Modified: 2013-11-25
Hi, I'm having an issue with the following code:

Imports System.Xml
Imports System.Data

Public Class xmlread
    Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub

    'NOTE: The following placeholder declaration is required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web Form Designer
        'Do not modify it using the code editor.
    End Sub

#End Region

    Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim reader As XmlTextReader

            reader = New XmlTextReader(Server.MapPath("books.xml"))
            While reader.Read()
                Response.Write("<b>" & reader.Name & "</b> " & reader.Value & "<br />")
            End While
        Catch ex As Exception
            Response.Write("Error accessing file")
        End Try
    End Sub

End Class

Which is generating thie following error message:

Parser Error Message: Could not load type 'adolearn.xmlread'.

Source Error:

Line 1:  <%@ Page Language="vb" AutoEventWireup="false" Codebehind="xmlread.aspx.vb" Inherits="adolearn.xmlread"%>
Line 2:  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
Line 3:  <HTML>
Does anyone have a clue on how to fix this?  I have a project set up in Visual Studio .NET called adolearn and the file generating the error is called xmlread.aspx.
Question by:Littlesey
    LVL 9

    Accepted Solution

    I think ur application has not been built.


    LVL 9

    Expert Comment

    If u r using

    Press Ctrl+shift+B

    and execute the page..

    Expert Comment


    What is the name of your project?
    The inherits part  in the @ page should ideally contain

    if no namespace mentioned then

    This should be the cause of the problem.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
    For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now