Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. System.UnauthorizedAccessException: Access to the path Denied.

System.UnauthorizedAccessException: Access to the path Denied.

Scheduled Pinned Locked Moved ASP.NET
helpasp-netdatabasecsharpsysadmin
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Biju Sam
    wrote on last edited by
    #1

    Hi, Sincere request to give a solution to my problem. I will explain in detail. I have an application in ASP.Net, Sybase which was running very fine in windows 2000 server. Recently i migrated it to a windows 2003/IIS6.0 server. After the migration one of the pages is having an error. This is the function which does this. public static bool Archive(string ReportID, string ReportDate, string User, DataTable ReportDataTable, string ProfileRegionID) { ArrayList ar = Report.ConvertToArrayList(ReportDataTable); // We can use this code here if we ever wanted to see the serialized content. // if (ReportID.Equals("1")) // DB.Data.Adaptors.XML.Serialize(ar,@"D:\Inetpub\Wwwroot\website2\AAA.xml"); AseParameter[] myParams = new AseParameter[1]; AseParameter p = new AseParameter(); p.ParameterName = "@report"; p.AseDbType = AseDbType.Text; byte[] ReportData = DB.Data.Adaptors.XML.ConvertToXMLStream(ar).ToArray(); p.Size =ReportData.Length; p.Value = ReportData; myParams[0] = p; Adaptor a = new Adaptor(); a.ExecuteStatement(@"insert into ReportHistory (report_id,report_date,report_data,create_user,create_date,profile_region_id,locked,version) " + @" values(" + ReportID + ","+ReportDate+",@report,'"+ User +"','" + System.DateTime.Now.ToShortDateString() + "',"+ProfileRegionID+",0,0)" ,myParams, CommandType.Text); a.Dispose(); return true; } In this function when the query executes an error saying Sybase.Data.AseClient.AseException: Operand type clash: IMAGE is incompatible with TEXT is coming To see what is the serialized data when i uncomment the bold lines in the function i get this error System.UnauthorizedAccessException: Access to the path "D:\Inetpub\Wwwroot\website2\AAA.xml" is denied. I have given ASPNET rights. but no use. Some one please please help me. Thanks in advance Biju S

    N 1 Reply Last reply
    0
    • B Biju Sam

      Hi, Sincere request to give a solution to my problem. I will explain in detail. I have an application in ASP.Net, Sybase which was running very fine in windows 2000 server. Recently i migrated it to a windows 2003/IIS6.0 server. After the migration one of the pages is having an error. This is the function which does this. public static bool Archive(string ReportID, string ReportDate, string User, DataTable ReportDataTable, string ProfileRegionID) { ArrayList ar = Report.ConvertToArrayList(ReportDataTable); // We can use this code here if we ever wanted to see the serialized content. // if (ReportID.Equals("1")) // DB.Data.Adaptors.XML.Serialize(ar,@"D:\Inetpub\Wwwroot\website2\AAA.xml"); AseParameter[] myParams = new AseParameter[1]; AseParameter p = new AseParameter(); p.ParameterName = "@report"; p.AseDbType = AseDbType.Text; byte[] ReportData = DB.Data.Adaptors.XML.ConvertToXMLStream(ar).ToArray(); p.Size =ReportData.Length; p.Value = ReportData; myParams[0] = p; Adaptor a = new Adaptor(); a.ExecuteStatement(@"insert into ReportHistory (report_id,report_date,report_data,create_user,create_date,profile_region_id,locked,version) " + @" values(" + ReportID + ","+ReportDate+",@report,'"+ User +"','" + System.DateTime.Now.ToShortDateString() + "',"+ProfileRegionID+",0,0)" ,myParams, CommandType.Text); a.Dispose(); return true; } In this function when the query executes an error saying Sybase.Data.AseClient.AseException: Operand type clash: IMAGE is incompatible with TEXT is coming To see what is the serialized data when i uncomment the bold lines in the function i get this error System.UnauthorizedAccessException: Access to the path "D:\Inetpub\Wwwroot\website2\AAA.xml" is denied. I have given ASPNET rights. but no use. Some one please please help me. Thanks in advance Biju S

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      Biju Sam wrote:

      D:\Inetpub\Wwwroot\website2\AAA.xml"

      Try using Server.MapPath()

      All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

      B 1 Reply Last reply
      0
      • N N a v a n e e t h

        Biju Sam wrote:

        D:\Inetpub\Wwwroot\website2\AAA.xml"

        Try using Server.MapPath()

        All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia My Website | Ask smart questions

        B Offline
        B Offline
        Biju Sam
        wrote on last edited by
        #3

        I gave permission to NETWORK SERVICE. it solved the problem.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups