473,748 Members | 4,951 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Request for the permission of type 'System.Data.Sq lClient.SqlClie ntPermission [.....]' 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.Sq lClient.SqlClie ntPermission, System.Data,
Version=2.0.0.0 , Culture=neutral , PublicKeyToken= b77a5c561934e08 9'
failed.
at System.Security .CodeAccessSecu rityEngine.Chec k(Object demand,
StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security .PermissionSet. Demand()
at System.Data.Com mon.DbConnectio nOptions.Demand Permission()
at System.Data.Sql Client.SqlConne ction.Permissio nDemand()
at
System.Data.Sql Client.SqlConne ctionFactory.Pe rmissionDemand( DbConnection
outerConnection )
at
System.Data.Pro viderBase.DbCon nectionClosed.O penConnection(D bConnection
outerConnection , DbConnectionFac tory connectionFacto ry)
at System.Data.Sql Client.SqlConne ction.Open()
at SkaneData.Data. dbLayer.Execute DataSet(String SqlStmt, String
tableName)
at BookStore.Data. MenuDbLayer.get MenuParents() in \
\192.168.153.13 0\djurfakta\App _Code\Classes\d bLayer.cs:line 32
at BookStore.Class es.Menu.generat eMenu(HttpConte xt Context, Int32
SelectedParent) in \\192.168.153.1 30\djurfakta\Ap p_Code\Classes
\Menu.cs:line 25
at BookStore.Index .generateMenu() in \\192.168.153.1 30\djurfakta
\index.aspx.cs: line 109
at BookStore.Index .Page_Load(Obje ct sender, EventArgs e) in \
\192.168.153.13 0\djurfakta\ind ex.aspx.cs:line 37
at System.Web.Util .CalliHelper.Ev entArgFunctionC aller(IntPtr fp,
Object o, Object t, EventArgs e)
at System.Web.Util .CalliEventHand lerDelegateProx y.Callback(Obje ct
sender, EventArgs e)
at System.Web.UI.C ontrol.OnLoad(E ventArgs e)
at System.Web.UI.C ontrol.LoadRecu rsive()
at System.Web.UI.P age.ProcessRequ estMain(Boolean
includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint)
at System.Web.UI.P age.ProcessRequ est(Boolean
includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint)
at System.Web.UI.P age.ProcessRequ est()
at System.Web.UI.P age.ProcessRequ estWithNoAssert (HttpContext context)
at System.Web.UI.P age.ProcessRequ est(HttpContext context)
at ASP.index_aspx. ProcessRequest( HttpContext context) in c:\WINDOWS
\Microsoft.NET\ Framework\v2.0. 50727\Temporary ASP.NET Files\root
\e7a2b103\21901 7a5\App_Web_x0i vfawf.24.cs:lin e 0
at
System.Web.Http Application.Cal lHandlerExecuti onStep.System.W eb.HttpApplicat ion.IExecutionS tep.Execute()
at System.Web.Http Application.Exe cuteStep(IExecu tionStep step,
Boolean& completedSynchr onously)

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.c onfig 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 connectionstrin g 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 7511
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
4697
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 type System.Data.SqlClient.SqlClientPermission, System.Data, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed." Would it bt a 'pure' dotnet problem or service/SQL Server problem?
1
1839
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 System.Data.SqlClient.SqlClientPermission, System.Data, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed." I'm a new to dotnet and after reading a number of MSDN pages I have no idea
1
3042
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 sql statement. It worked fine, but after I did some modifications to my dll, I got error. The strange thing is the first call to the code runs fine, but the calls after will return the following error:
2
20845
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. Security Exception Description: The application attempted to perform an operation not
0
1136
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 fine on my local machine but throws a CAS error on client machines that says: Request for the permission of type System.Data.SqlClient.SqlClientPermission
1
2837
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 fine on my local machine but throws a CAS error on client machines that says: Request for the permission of type System.Data.SqlClient.SqlClientPermission
3
12061
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 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. (machine.config) ---> System.Security.SecurityException: Request for the permission of type
0
1596
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 with no problem. The problem is: when i try to run the application directly from the exe file, every time there is a connection to the same database (and with exactly the same connection string) that i connected with no problem in development...
5
8330
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 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: for the permission of type
0
8828
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9537
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9367
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9243
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8241
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6795
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4599
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2213
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.