System.Security.SecurityException {Beginner working with ASP.NET}

Discussion in 'ASP .Net Security' started by AMT2K5, Mar 10, 2006.

  1. AMT2K5

    AMT2K5 Guest

    Hello, I am a student working on an ASP.NET assignment for my course.

    I am using Visual Studio 2003.

    All I have is a simple web form with a datagrid. I added a data adapter
    and generated a dataset off a table on my schools server with data. In
    the page_load I fill the data adapter, bind the data to the grid and
    close the connection. I am able to preview the data set being filled in
    the properties pane.

    I get this exception when attempting to view my webform in IE6.

    Security Exception
    Exception Details: System.Security.SecurityException: Request failed.
    Stack:
    [SecurityException: Request failed.]
    admin.UserManagementSummary.InitializeComponent() +0
    admin.UserManagementSummary.OnInit(EventArgs e) in
    usermanagementsummary.aspx.cs:36
    System.Web.UI.Control.InitRecursive(Control namingContainer) +241
    System.Web.UI.Page.ProcessRequestMain() +2112
    System.Web.UI.Page.ProcessRequest() +218
    System.Web.UI.Page.ProcessRequest(HttpContext context) +18

    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
    +179
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
    completedSynchronously) +87

    Now all my page_load has is

    private void Page_Load(object sender, System.EventArgs e)
    {
    dbCon.Open(); //Open connection
    dbDA.Fill(dsDS1); //Fill the data adapter with the dataset
    dgUsers.DataBind(); //Bind the grid
    dbCon.Close(); //Close connection
    }

    I am using the following for this assignment.
    Version Information: Microsoft .NET Framework Version:1.1.4322.2300;
    ASP.NET Version:1.1.4322.2300

    Appreciate any help
     
    AMT2K5, Mar 10, 2006
    #1
    1. Advertising

  2. Hi,

    seems like the server is runnning with partial trust.

    What kind of database are you accessing?

    ---------------------------------------
    Dominick Baier - DevelopMentor
    http://www.leastprivilege.com

    > Hello, I am a student working on an ASP.NET assignment for my course.
    >
    > I am using Visual Studio 2003.
    >
    > All I have is a simple web form with a datagrid. I added a data
    > adapter and generated a dataset off a table on my schools server with
    > data. In the page_load I fill the data adapter, bind the data to the
    > grid and close the connection. I am able to preview the data set being
    > filled in the properties pane.
    >
    > I get this exception when attempting to view my webform in IE6.
    >
    > Security Exception
    > Exception Details: System.Security.SecurityException: Request failed.
    > Stack:
    > [SecurityException: Request failed.]
    > admin.UserManagementSummary.InitializeComponent() +0
    > admin.UserManagementSummary.OnInit(EventArgs e) in
    > usermanagementsummary.aspx.cs:36
    > System.Web.UI.Control.InitRecursive(Control namingContainer) +241
    > System.Web.UI.Page.ProcessRequestMain() +2112
    > System.Web.UI.Page.ProcessRequest() +218
    > System.Web.UI.Page.ProcessRequest(HttpContext context) +18
    > System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecut
    > ionStep.Execute()
    > +179
    > System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
    > Boolean&
    > completedSynchronously) +87
    > Now all my page_load has is
    >
    > private void Page_Load(object sender, System.EventArgs e)
    > {
    > dbCon.Open(); //Open connection
    > dbDA.Fill(dsDS1); //Fill the data adapter with the dataset
    > dgUsers.DataBind(); //Bind the grid
    > dbCon.Close(); //Close connection
    > }
    > I am using the following for this assignment.
    > Version Information: Microsoft .NET Framework Version:1.1.4322.2300;
    > ASP.NET Version:1.1.4322.2300
    > Appreciate any help
    >
     
    Dominick Baier [DevelopMentor], Mar 10, 2006
    #2
    1. Advertising

  3. It also looks like there might be a try/catch block on the page that is
    rethrowing an exception as the complete stack trace to the code that threw
    the exception is not available. That is generally not a good thing from an
    error handling perspective. Either don't catch at all or just use "throw"
    instead of throwing the exception.

    Joe K.

    "Dominick Baier [DevelopMentor]" <>
    wrote in message news:...
    > Hi,
    > seems like the server is runnning with partial trust.
    >
    > What kind of database are you accessing?
    >
    > ---------------------------------------
    > Dominick Baier - DevelopMentor
    > http://www.leastprivilege.com
    >
    >> Hello, I am a student working on an ASP.NET assignment for my course.
    >>
    >> I am using Visual Studio 2003.
    >>
    >> All I have is a simple web form with a datagrid. I added a data
    >> adapter and generated a dataset off a table on my schools server with
    >> data. In the page_load I fill the data adapter, bind the data to the
    >> grid and close the connection. I am able to preview the data set being
    >> filled in the properties pane.
    >>
    >> I get this exception when attempting to view my webform in IE6.
    >>
    >> Security Exception
    >> Exception Details: System.Security.SecurityException: Request failed.
    >> Stack:
    >> [SecurityException: Request failed.]
    >> admin.UserManagementSummary.InitializeComponent() +0
    >> admin.UserManagementSummary.OnInit(EventArgs e) in
    >> usermanagementsummary.aspx.cs:36
    >> System.Web.UI.Control.InitRecursive(Control namingContainer) +241
    >> System.Web.UI.Page.ProcessRequestMain() +2112
    >> System.Web.UI.Page.ProcessRequest() +218
    >> System.Web.UI.Page.ProcessRequest(HttpContext context) +18
    >> System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecut
    >> ionStep.Execute()
    >> +179
    >> System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
    >> Boolean&
    >> completedSynchronously) +87
    >> Now all my page_load has is
    >>
    >> private void Page_Load(object sender, System.EventArgs e)
    >> {
    >> dbCon.Open(); //Open connection
    >> dbDA.Fill(dsDS1); //Fill the data adapter with the dataset
    >> dgUsers.DataBind(); //Bind the grid
    >> dbCon.Close(); //Close connection
    >> }
    >> I am using the following for this assignment.
    >> Version Information: Microsoft .NET Framework Version:1.1.4322.2300;
    >> ASP.NET Version:1.1.4322.2300
    >> Appreciate any help
    >>

    >
    >
     
    Joe Kaplan \(MVP - ADSI\), Mar 10, 2006
    #3
  4. to me it looks like partial trust, access or odbc and some full trust link
    demand...

    the error looks like that.

    ---------------------------------------
    Dominick Baier - DevelopMentor
    http://www.leastprivilege.com

    > It also looks like there might be a try/catch block on the page that
    > is rethrowing an exception as the complete stack trace to the code
    > that threw the exception is not available. That is generally not a
    > good thing from an error handling perspective. Either don't catch at
    > all or just use "throw" instead of throwing the exception.
    >
    > Joe K.
    >
    > "Dominick Baier [DevelopMentor]"
    > <> wrote in message
    > news:...
    >
    >> Hi,
    >> seems like the server is runnning with partial trust.
    >> What kind of database are you accessing?
    >>
    >> ---------------------------------------
    >> Dominick Baier - DevelopMentor
    >> http://www.leastprivilege.com
    >>> Hello, I am a student working on an ASP.NET assignment for my
    >>> course.
    >>>
    >>> I am using Visual Studio 2003.
    >>>
    >>> All I have is a simple web form with a datagrid. I added a data
    >>> adapter and generated a dataset off a table on my schools server
    >>> with data. In the page_load I fill the data adapter, bind the data
    >>> to the grid and close the connection. I am able to preview the data
    >>> set being filled in the properties pane.
    >>>
    >>> I get this exception when attempting to view my webform in IE6.
    >>>
    >>> Security Exception
    >>> Exception Details: System.Security.SecurityException: Request
    >>> failed.
    >>> Stack:
    >>> [SecurityException: Request failed.]
    >>> admin.UserManagementSummary.InitializeComponent() +0
    >>> admin.UserManagementSummary.OnInit(EventArgs e) in
    >>> usermanagementsummary.aspx.cs:36
    >>> System.Web.UI.Control.InitRecursive(Control namingContainer) +241
    >>> System.Web.UI.Page.ProcessRequestMain() +2112
    >>> System.Web.UI.Page.ProcessRequest() +218
    >>> System.Web.UI.Page.ProcessRequest(HttpContext context) +18
    >>> System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExec
    >>> ut
    >>> ionStep.Execute()
    >>> +179
    >>> System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
    >>> Boolean&
    >>> completedSynchronously) +87
    >>> Now all my page_load has is
    >>> private void Page_Load(object sender, System.EventArgs e)
    >>> {
    >>> dbCon.Open(); //Open connection
    >>> dbDA.Fill(dsDS1); //Fill the data adapter with the dataset
    >>> dgUsers.DataBind(); //Bind the grid
    >>> dbCon.Close(); //Close connection
    >>> }
    >>> I am using the following for this assignment.
    >>> Version Information: Microsoft .NET Framework Version:1.1.4322.2300;
    >>> ASP.NET Version:1.1.4322.2300
    >>> Appreciate any help
     
    Dominick Baier [DevelopMentor], Mar 10, 2006
    #4
  5. AMT2K5

    AMT2K5 Guest

    Thanks for the replies
    Is this something I can fix on my end? I am able to preview the data
    correctly being filled in the adapter in the properties pane, does this
    mean that I do have the access rights to the data?
     
    AMT2K5, Mar 10, 2006
    #5
  6. Yeah, I think the same thing. I would just expect the stack trace to come
    from SqlClient or OleDb. It seemed "cut off" to me, which tends to indicate
    a "catch and rethrow" type of exception handling pattern. I hate those. :)

    Sorry if I wasn't clear.

    Joe K.

    "Dominick Baier [DevelopMentor]" <>
    wrote in message news:...
    > to me it looks like partial trust, access or odbc and some full trust link
    > demand...
    >
    > the error looks like that.
    >
    > ---------------------------------------
    > Dominick Baier - DevelopMentor
    > http://www.leastprivilege.com
    >
    >> It also looks like there might be a try/catch block on the page that
    >> is rethrowing an exception as the complete stack trace to the code
    >> that threw the exception is not available. That is generally not a
    >> good thing from an error handling perspective. Either don't catch at
    >> all or just use "throw" instead of throwing the exception.
    >>
    >> Joe K.
    >>
    >> "Dominick Baier [DevelopMentor]"
    >> <> wrote in message
    >> news:...
    >>
    >>> Hi,
    >>> seems like the server is runnning with partial trust.
    >>> What kind of database are you accessing?
    >>>
    >>> ---------------------------------------
    >>> Dominick Baier - DevelopMentor
    >>> http://www.leastprivilege.com
    >>>> Hello, I am a student working on an ASP.NET assignment for my
    >>>> course.
    >>>>
    >>>> I am using Visual Studio 2003.
    >>>>
    >>>> All I have is a simple web form with a datagrid. I added a data
    >>>> adapter and generated a dataset off a table on my schools server
    >>>> with data. In the page_load I fill the data adapter, bind the data
    >>>> to the grid and close the connection. I am able to preview the data
    >>>> set being filled in the properties pane.
    >>>>
    >>>> I get this exception when attempting to view my webform in IE6.
    >>>>
    >>>> Security Exception
    >>>> Exception Details: System.Security.SecurityException: Request
    >>>> failed.
    >>>> Stack:
    >>>> [SecurityException: Request failed.]
    >>>> admin.UserManagementSummary.InitializeComponent() +0
    >>>> admin.UserManagementSummary.OnInit(EventArgs e) in
    >>>> usermanagementsummary.aspx.cs:36
    >>>> System.Web.UI.Control.InitRecursive(Control namingContainer) +241
    >>>> System.Web.UI.Page.ProcessRequestMain() +2112
    >>>> System.Web.UI.Page.ProcessRequest() +218
    >>>> System.Web.UI.Page.ProcessRequest(HttpContext context) +18
    >>>> System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExec
    >>>> ut
    >>>> ionStep.Execute()
    >>>> +179
    >>>> System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
    >>>> Boolean&
    >>>> completedSynchronously) +87
    >>>> Now all my page_load has is
    >>>> private void Page_Load(object sender, System.EventArgs e)
    >>>> {
    >>>> dbCon.Open(); //Open connection
    >>>> dbDA.Fill(dsDS1); //Fill the data adapter with the dataset
    >>>> dgUsers.DataBind(); //Bind the grid
    >>>> dbCon.Close(); //Close connection
    >>>> }
    >>>> I am using the following for this assignment.
    >>>> Version Information: Microsoft .NET Framework Version:1.1.4322.2300;
    >>>> ASP.NET Version:1.1.4322.2300
    >>>> Appreciate any help

    >
    >
     
    Joe Kaplan \(MVP - ADSI\), Mar 10, 2006
    #6
  7. AMT2K5

    AMT2K5 Guest

    I dont even have any try catch statement in my code. Brand new webform,
    only 3 lines in my page_load()
     
    AMT2K5, Mar 10, 2006
    #7
  8. AMT2K5

    AMT2K5 Guest

    Could be my connection string, im checking it out.
     
    AMT2K5, Mar 10, 2006
    #8
  9. Really? Wow. And that was the whole stack trace? I'm not sure what throws
    an exception from InitializeComponent. Is there any code in there?

    The result you are getting looks a little strange to me. Maybe D. knows...

    Joe K.


    "AMT2K5" <> wrote in message
    news:...
    >I dont even have any try catch statement in my code. Brand new webform,
    > only 3 lines in my page_load()
    >
     
    Joe Kaplan \(MVP - ADSI\), Mar 10, 2006
    #9
  10. AMT2K5

    AMT2K5 Guest

    Weird, I just tried doing what I wanted to do with a simple
    SQLDataReader and it works perfectly. Why cant I use a dataset and
    adapter to accomplish the same thing using the Wizard?
     
    AMT2K5, Mar 10, 2006
    #10
  11. AMT2K5

    AMT2K5 Guest

    I just tried what i wanted to accomplish using a simple SQL Data Reader
    and it worked perfectly, wow.

    Something in those darn wizards isnt letting me do it the fun way.
     
    AMT2K5, Mar 10, 2006
    #11
  12. no idea. i thought it is CAS related - but if sqldatareader works sqldataadapter
    will work too...

    ---------------------------------------
    Dominick Baier - DevelopMentor
    http://www.leastprivilege.com

    > Really? Wow. And that was the whole stack trace? I'm not sure what
    > throws an exception from InitializeComponent. Is there any code in
    > there?
    >
    > The result you are getting looks a little strange to me. Maybe D.
    > knows...
    >
    > Joe K.
    >
    > "AMT2K5" <> wrote in message
    > news:...
    >
    >> I dont even have any try catch statement in my code. Brand new
    >> webform, only 3 lines in my page_load()
    >>
     
    Dominick Baier [DevelopMentor], Mar 10, 2006
    #12
  13. AMT2K5

    AMT2K5 Guest

    Anyone else have any other ideas?

    Dominick wrote:
    > no idea. i thought it is CAS related - but if sqldatareader works sqldataadapter
    > will work too...
    >
    > ---------------------------------------
    > Dominick Baier - DevelopMentor
    > http://www.leastprivilege.com
    >
    > > Really? Wow. And that was the whole stack trace? I'm not sure what
    > > throws an exception from InitializeComponent. Is there any code in
    > > there?
    > >
    > > The result you are getting looks a little strange to me. Maybe D.
    > > knows...
    > >
    > > Joe K.
    > >
    > > "AMT2K5" <> wrote in message
    > > news:...
    > >
    > >> I dont even have any try catch statement in my code. Brand new
    > >> webform, only 3 lines in my page_load()
    > >>
     
    AMT2K5, Mar 11, 2006
    #13
  14. Is it possible that something in the wizard-generated code is referencing
    something on a file share or some other weird thing like that? I'm not a
    wizard guy at all, so I don't really know what they are doing from a code
    gen perspective, but digging into the code might reveal what the issue is.

    I agree with D. that it doesn't make any sense that the behavior should be
    different.

    Joe K.

    "AMT2K5" <> wrote in message
    news:...
    > Anyone else have any other ideas?
    >
    > Dominick wrote:
    >> no idea. i thought it is CAS related - but if sqldatareader works
    >> sqldataadapter
    >> will work too...
    >>
    >> ---------------------------------------
    >> Dominick Baier - DevelopMentor
    >> http://www.leastprivilege.com
    >>
    >> > Really? Wow. And that was the whole stack trace? I'm not sure what
    >> > throws an exception from InitializeComponent. Is there any code in
    >> > there?
    >> >
    >> > The result you are getting looks a little strange to me. Maybe D.
    >> > knows...
    >> >
    >> > Joe K.
    >> >
    >> > "AMT2K5" <> wrote in message
    >> > news:...
    >> >
    >> >> I dont even have any try catch statement in my code. Brand new
    >> >> webform, only 3 lines in my page_load()
    >> >>

    >
     
    Joe Kaplan \(MVP - ADSI\), Mar 11, 2006
    #14
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ali
    Replies:
    0
    Views:
    640
  2. =?Utf-8?B?S2lzaG9yZSBHb3BhbGFu?=

    (continued...System.Security.SecurityException

    =?Utf-8?B?S2lzaG9yZSBHb3BhbGFu?=, Oct 7, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    379
  3. Luis Esteban Valencia
    Replies:
    0
    Views:
    4,137
    Luis Esteban Valencia
    Jul 14, 2005
  4. Siberwulf
    Replies:
    0
    Views:
    1,647
    Siberwulf
    Oct 6, 2006
  5. Leyla
    Replies:
    2
    Views:
    715
    Leyla
    Aug 17, 2006
Loading...

Share This Page