I am new to ASPX.
I get the following error when I try to run my page:
_________________________________
Server Error in '/BegASPNETdb' Application.
--------------------------------------------------------------------------------
Access denied to 'C:\BegASPNETdb\webroot\ch03\web.config'. Failed to start monitoring file changes.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Access denied to 'C:\BegASPNETdb\webroot\ch03\web.config'. Failed to start monitoring file changes.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80070005): Access denied to 'C:\BegASPNETdb\webroot\ch03\web.config'. Failed to start monitoring file changes.]
System.Web.DirectoryMonitor.AddFileMonitor(String file) +381
System.Web.DirectoryMonitor.StartMonitoringFile(St ring file, FileChangeEventHandler callback, String alias) +76
System.Web.FileChangesMonitor.StartMonitoringFile( String alias, FileChangeEventHandler callback) +322
System.Web.Configuration.HttpConfigurationSystem.A ddFileDependency(String file) +139
System.Web.Configuration.HttpConfigurationSystem.C omposeConfig(String reqPath, IHttpMapPath configmap) +503
System.Web.HttpContext.GetCompleteConfigRecord(Str ing reqpath, IHttpMapPath configmap) +434
System.Web.HttpContext.GetCompleteConfig() +49
System.Web.HttpContext.GetConfig(String name) +195
System.Web.CustomErrors.GetSettings(HttpContext context, Boolean canThrow)
System.Web.HttpResponse.ReportRuntimeError(Excepti on e, Boolean canThrow)
System.Web.HttpRuntime.FinishRequest(HttpWorkerReq uest wr, HttpContext context, Exception e) +486
__________________________________________
This is what on my page:
<%@ Import namespace="System.Data" %>
<%@ Import namespace="System.Data.SqlClient" %>
<html>
<head>
<title>Beginning ASP.NET Databases Chapter 3</title>
</head>
<body>
<h4>First Example: Listing data from the Employees table</h4>
<asp:DataGrid id="dgNameList"
runat="server"
Gridlines="None"
BackColor="LightBlue"
CellPadding="5"
CellSpacing="5"
BorderWidth="2"
BorderColor="Black"
ToolTip="Includes only those employees who are at HQ" />
<body>
</html>
<script language="
VB" runat="server">
Sub Page_Load(Source As Object, E As EventArgs)
Dim strConnection As String = "server=(local)\NetSDK; database=Northwind; " & _
"integrated security=true"
Dim objConnection As New SqlConnection(strConnection)
Dim strSQL As String = "SELECT FirstName, LastName, Country " & _
"FROM Employees;"
Dim objCommand As New SqlCommand(strSQL, objConnection)
objConnection.Open()
Response.Write("ServerVersion: " & objConnection.ServerVersion & _
vbCRLF & "Datasource: " & objConnection.DataSource & _
vbCRLF & "Database: " & objConnection.Database)
dgNameList.DataSource = objCommand.ExecuteReader()
dgNameList.DataBind()
objConnection.Close()
End Sub
</script>
And the following in my Web.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<customErrors mode="off" />
<compilation debug="true" />
</system.web>
</configuration>
Any suggestions????? Thanks