Server Error in '/' Application.

Security Exception

Description: The application attempted to perform an operation not allowed by the security policy.  To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Data.OleDb.OleDbPermission, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Source Error:


Line 25:         sqlAdp.SelectCommand = new OleDbCommand(sqlCmd, sqlConn);
Line 26:         DataTable ds = new DataTable();
Line 27:         sqlConn.Open();
Line 28:         sqlAdp.Fill(ds);
Line 29:         sqlConn.Close();

Source File: c:\hosting\pousadaguardiao\pousadaguardiaodaserra.com.br\wwwroot\App_Code\Conexao.cs    Line: 27

Stack Trace:


[SecurityException: Request for the permission of type 'System.Data.OleDb.OleDbPermission, System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
   System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
   System.Security.PermissionSet.Demand() +83
   System.Data.Common.DbConnectionOptions.DemandPermission() +52
   System.Data.OleDb.OleDbConnectionFactory.PermissionDemand(DbConnection outerConnection) +32
   System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +315
   System.Data.ProviderBase.DbConnectionInternal.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +23
   System.Data.OleDb.OleDbConnection.Open() +53
   Conexao.retornaDataTable(String sqlCmd) in c:\hosting\pousadaguardiao\pousadaguardiaodaserra.com.br\wwwroot\App_Code\Conexao.cs:27
   _Default.Page_Load(Object sender, EventArgs e) in c:\hosting\pousadaguardiao\pousadaguardiaodaserra.com.br\wwwroot\Default.aspx.cs:20
   System.Web.UI.Control.OnLoad(EventArgs e) +108
   System.Web.UI.Control.LoadRecursive() +90
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +9318
   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +355
   System.Web.UI.Page.ProcessRequest() +79
   System.Web.UI.Page.ProcessRequest(HttpContext context) +74
   ASP.default_aspx.ProcessRequest(HttpContext context) in App_Web_r5thgexm.2.cs:0
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +542
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +75
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +93


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4700.0