473,396 Members | 1,987 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Request for the permission of type 'System.Data.SqlClient.SqlClientPermission [.....]' failed

goc
I have a Web Farm, that fetches its database-data from a separate
database-server. Today I was forced to go over to .NET 2.0 (since 1.1
can't be installed on Windows Vista x64), and it brought about quite
alot of problems. But now I've sorted out everything except one
problem that I just can't get to disappear:

As soon as I try to connect to a database from my code and run a
query, I get an exception thrown:

Check: Request for the permission of type
'System.Data.SqlClient.SqlClientPermission, System.Data,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
failed.
at System.Security.CodeAccessSecurityEngine.Check(Obj ect demand,
StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.PermissionSet.Demand()
at System.Data.Common.DbConnectionOptions.DemandPermi ssion()
at System.Data.SqlClient.SqlConnection.PermissionDema nd()
at
System.Data.SqlClient.SqlConnectionFactory.Permiss ionDemand(DbConnection
outerConnection)
at
System.Data.ProviderBase.DbConnectionClosed.OpenCo nnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at SkaneData.Data.dbLayer.ExecuteDataSet(String SqlStmt, String
tableName)
at BookStore.Data.MenuDbLayer.getMenuParents() in \
\192.168.153.130\djurfakta\App_Code\Classes\dbLaye r.cs:line 32
at BookStore.Classes.Menu.generateMenu(HttpContext Context, Int32
SelectedParent) in \\192.168.153.130\djurfakta\App_Code\Classes
\Menu.cs:line 25
at BookStore.Index.generateMenu() in \\192.168.153.130\djurfakta
\index.aspx.cs:line 109
at BookStore.Index.Page_Load(Object sender, EventArgs e) in \
\192.168.153.130\djurfakta\index.aspx.cs:line 37
at System.Web.Util.CalliHelper.EventArgFunctionCaller (IntPtr fp,
Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Cal lback(Object
sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(Http Context context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.index_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS
\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root
\e7a2b103\219017a5\App_Web_x0ivfawf.24.cs:line 0
at
System.Web.HttpApplication.CallHandlerExecutionSte p.System.Web.HttpApplication.IExecutionStep.Execut e()
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step,
Boolean& completedSynchronously)

I really have no idea of how to fix this. Since the code is compiled
at runtime in .NET 2.0, there's no DLL to increase the rights of (not
even sure it would have worked if I had a dll), and I've tried just
about every modification to web.config that I can think of (like cut-n-
pasting everything from web_hightrust.config into my own web.config,
and have followed every tip that I've been able to find on the net
(that all were regarding real applications, and therefore had little
help to provide)). But no matter what I do, the problem it just
doesn't go away...

The connectionstring and such are of course correct (havn't changed
them since the .NET 1.1-version that worked perfectly). One strange
thing, is that ASP.NET can connect to the state-databases and use it,
but it can't connect to my own databases.

Pleas help!

Feb 1 '07 #1
1 7455
goc
It seems that this problem is somehow related to the fact that the
source files aren't located on the webserver, but are instead read
from a network share on a different server. So if I copy the site to
the local disc of one of the web servers, it works like it should on
that server. Hope this helps you help me, cause I'm really at a loss
here...

Feb 1 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Marius Horak | last post by:
I have a window (not webservice) service written in c#. It's running under MyDomain/Administrator account. It fails to execute any store procedure. The error is: "Request for the permission of...
1
by: Marius Horak | last post by:
I have a window application written in c#. It connects to a remote SQL Server but it fails to execute any store procedure. The error is: "Request for the permission of type...
1
by: davidw | last post by:
I encountered strange issues. I have code like this sqlReader = SqlHelper.ExecuteReader(connString, System.Data.CommandType.Text,sql); It calls Microsoft.ApplicationBlocks.Data to execute a...
2
by: AnalogKid17 | last post by:
Keywords: ASP.NET app with VS2005 running on Win2003 with IIS6, and SQL2000 on a WinXP Box I've betting the following for days... it's driving me insane: Server Error in '/' Application. ...
0
by: sumguyb | last post by:
I've written a Windows application using VB and Visual Studio 2005. I've used the Data Application Block in the Microsoft Enterprise Library 2.0 to make all of my SQL calls. The application runs...
1
by: sumguyb | last post by:
I've written a Windows application using VB and Visual Studio 2005. I've used the Data Application Block in the Microsoft Enterprise Library 2.0 to make all of my SQL calls. The application runs...
3
by: Mike | last post by:
Hi I have problem as folow: Caught Exception: System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: Request for the permission of type...
0
by: JoaquimC | last post by:
Hello all, I've a C# application connecting to a SQL Server 2005 DataBase and it all works well in development ambient. I'm developing with Visual Studio 2005 and i can connect to the DataBase...
5
by: Henry Stock | last post by:
I am trying to understand the following error: Any thing you can tell me about this is appreciated. Security Exception Description: The application attempted to perform an operation not allowed...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.