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

A

AMT2K5

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
 
D

Dominick Baier [DevelopMentor]

Hi,

seems like the server is runnning with partial trust.

What kind of database are you accessing?
 
J

Joe Kaplan \(MVP - ADSI\)

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 said:
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
 
D

Dominick Baier [DevelopMentor]

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.

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
 
A

AMT2K5

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?
 
J

Joe Kaplan \(MVP - ADSI\)

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 said:
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.

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
 
A

AMT2K5

I dont even have any try catch statement in my code. Brand new webform,
only 3 lines in my page_load()
 
J

Joe Kaplan \(MVP - ADSI\)

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.
 
A

AMT2K5

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?
 
A

AMT2K5

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.
 
D

Dominick Baier [DevelopMentor]

no idea. i thought it is CAS related - but if sqldatareader works sqldataadapter
will work too...
 
J

Joe Kaplan \(MVP - ADSI\)

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top