Littlesey
asked on
XML Data Access Error with ASP.NET & Visual Studio .NET
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.Debugg erStepThro ugh()> Private Sub InitializeComponent()
End Sub
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclara tion 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.
InitializeComponent()
End Sub
#End Region
Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim reader As XmlTextReader
Try
reader = New XmlTextReader(Server.MapPa th("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")
Finally
reader.Close()
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.v b" 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.
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.Debugg
End Sub
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclara
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.
InitializeComponent()
End Sub
#End Region
Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim reader As XmlTextReader
Try
reader = New XmlTextReader(Server.MapPa
While reader.Read()
Response.Write("<b>" & reader.Name & "</b> " & reader.Value & "<br />")
End While
Catch ex As Exception
Response.Write("Error accessing file")
Finally
reader.Close()
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.v
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi
What is the name of your project?
The inherits part in the @ page should ideally contain
projectname.namespace.clas sname
if no namespace mentioned then
projectname.classname
This should be the cause of the problem.
What is the name of your project?
The inherits part in the @ page should ideally contain
projectname.namespace.clas
if no namespace mentioned then
projectname.classname
This should be the cause of the problem.
Press Ctrl+shift+B
and execute the page..