Security Error attempting to access SQL Database

From: sakieboy (sakieboy_at_discussions.microsoft.com)
Date: 02/11/05


Date: Fri, 11 Feb 2005 05:47:02 -0800

My server has Sharepoint installed on it and SQL. When attempting to run my
aspx page I receive the following error.

[SecurityException: Request for the permission of type
System.Data.SqlClient.SqlClientPermission, System.Data, Version=1.0.5000.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.]
   System.Security.CodeAccessSecurityEngine.CheckHelper(PermissionSet
grantedSet, PermissionSet deniedSet, CodeAccessPermission demand,
PermissionToken permToken) +666
   System.Security.CodeAccessSecurityEngine.Check(PermissionToken permToken,
CodeAccessPermission demand, StackCrawlMark& stackMark, Int32 checkFrames,
Int32 unrestrictedOverride) +0
   System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap,
StackCrawlMark& stackMark) +88
   System.Security.CodeAccessPermission.Demand() +62
   System.Data.SqlClient.SqlConnectionString.Demand(SqlConnectionString
constr) +34
   System.Data.SqlClient.SqlConnection.Open() +43
   System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
ConnectionState& originalState) +44
   System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +304
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
behavior) +77
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +36
   JJGApplication.JJGApplication.GetDropDownType(Object DLOrLST) in
JJGApplication.aspx.vb:486

This is the main part so I didn't copy the rest...

I can aleviate this error by removing the
"Inherits=MyApplication.MyApplication" from the 1st line in the ASPX page but
it still cannot seem to find the database. When I run an ASP page, I can get
access to the database.
I'm using the same connection string except that the one for the ASP file
comes from an include file and the one for the ASPX file is in the
Global.aspx.vb file.

Is there a quick test page that I can use to verify that my ASPX page is in
touch with the database. It appears that my ASPX page is reading the BIN
file and displaying the error.

Thanks

Please email all replies to sakieboy@hotmail.com, because I'm not a frequent
visitor to this site.



Relevant Pages

  • Security Error
    ... I have a ASP.net application that work fine with IIS 5.0. ... To grant this application the required permission ... CodeAccessPermission demand, StackCrawlMark& stackMark, Int32 checkFrames, ... Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior ...
    (microsoft.public.dotnet.framework.aspnet)
  • Security Error
    ... To grant this application the required permission ... Exception Details: System.Security.SecurityException: Request for the ... CodeAccessPermission demand, StackCrawlMark& stackMark, Int32 checkFrames, ... Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior ...
    (microsoft.public.de.inetserver.iis.asp)
  • Re: ASPX : ACCESS denied when start/stop windows services
    ... Give it a specific username and password to use. ... > but still i am not able to access the services from aspx pages. ... >> permission to interact with windows services. ... >>> i do need to control my windows services using aspx pages. ...
    (microsoft.public.dotnet.framework.aspnet)
  • RE: Security Error attempting to access SQL Database
    ... > aspx page I receive the following error. ... > grantedSet, PermissionSet deniedSet, CodeAccessPermission demand, ... > CodeAccessPermission demand, StackCrawlMark& stackMark, Int32 checkFrames, ... > Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior ...
    (microsoft.public.sqlserver.security)
  • Re: ASPX : ACCESS denied when start/stop windows services
    ... i added the impersonate="true" in my config files. ... but still i am not able to access the services from aspx pages. ... > permission to interact with windows services. ... >> i do need to control my windows services using aspx pages. ...
    (microsoft.public.dotnet.framework.aspnet)