This is a migrated thread and some comments may be shown as answers.

Telerik.OpenAccess.Exceptions.DataStoreException: Required security permission not given for the database driver used.

6 Answers 516 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
serkanp
Top achievements
Rank 1
serkanp asked on 01 Jun 2011, 11:27 AM
Telerik.OpenAccess.Exceptions.DataStoreException: Required security permission not given for the database driver used. Telerik.OpenAccess.RT.sql.SQLException: Required security permission not given for the database driver used. ---> System.Security.SecurityException: 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(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
   at System.Security.PermissionSet.Demand()
   at System.Data.Common.DbConnectionOptions.DemandPermission()
   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.SqlClient.SqlConnection.Open()
   at OpenAccessRuntime.Intellitrace.OpenConnection(IDbConnection connection, String connectionString, String id)
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.DBDriver.connect(ConnectionString connectionString, IDictionary driverProps)
The action that failed was:
Demand
The type of the first permission that failed was:
System.Data.SqlClient.SqlClientPermission
The Zone of the assembly that failed was:
Internet
   --- End of inner exception stack trace ---
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.DBDriver.connect(ConnectionString connectionString, IDictionary driverProps)
   at OpenAccessRuntime.Relational.sql.SqlDriver.InitializeFor(String url, Boolean noConnect, PropertySet props, Driver& driver, Connection& conn) ---> Telerik.OpenAccess.RT.sql.SQLException: Required security permission not given for the database driver used. ---> System.Security.SecurityException: 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(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
   at System.Security.PermissionSet.Demand()
   at System.Data.Common.DbConnectionOptions.DemandPermission()
   at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.SqlClient.SqlConnection.Open()
   at OpenAccessRuntime.Intellitrace.OpenConnection(IDbConnection connection, String connectionString, String id)
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.DBDriver.connect(ConnectionString connectionString, IDictionary driverProps)
   --- End of inner exception stack trace ---
   at Telerik.OpenAccess.RT.Adonet2Generic.Impl.DBDriver.connect(ConnectionString connectionString, IDictionary driverProps)
   at OpenAccessRuntime.Relational.sql.SqlDriver.InitializeFor(String url, Boolean noConnect, PropertySet props, Driver& driver, Connection& conn)
   --- End of inner exception stack trace ---
   at Telerik.OpenAccess.RT.ExceptionWrapper.Throw()
   at OpenAccessRuntime.storagemanager.StorageManagerFactoryBuilder.createSmfForURL()
   at OpenAccessRuntime.storagemanager.StorageManagerFactoryBuilder.createStorageManagerFactory()
   at OpenAccessRuntime.DataObjects.PersistenceManagerFactoryImp.createStorageManagerFactory()
   at OpenAccessRuntime.DataObjects.PersistenceManagerFactoryBase.init()
   at OpenAccessRuntime.DataObjects.PersistenceManagerFactoryImp.init()
   at OpenAccessRuntime.DataObjects.BootstrapPMF.getPersistenceManagerFactory(PropertySet props)
   at Telerik.OpenAccess.RT.Helper.getPersistenceManagerFactory(PropertySet props)
   at Telerik.OpenAccess.RT.DatabaseAdapter.AssertPersistenceManagerFactory(String usr, String password, Boolean open)
   at Telerik.OpenAccess.RT.DatabaseAdapter.GetObjectScope(TransactionProvider provider)
   at Telerik.OpenAccess.Database.GetObjectScope(TransactionProvider provider)
   at Telerik.OpenAccess.OpenAccessContextBase.GetScope()
   at Telerik.OpenAccess.OpenAccessContext.GetAll[T]()
   at smgservices.signageDB.get_Screens() in D:\codes\smg\signagesystem\current\smgservices2\edSignage.cs:line 72
   at smgservices.smgservices.getOnlineDevices() in D:\codes\smg\signagesystem\current\smgservices2\smgservices1.1.asmx.cs:line 1229


normally my application was running more then 2 months.. 
but yesterday suddenly i get this error.. 
how can i solve this?
db used is sql server express 2008 r2 

6 Answers, 1 is accepted

Sort by
0
serkanp
Top achievements
Rank 1
answered on 03 Jun 2011, 03:53 PM
still need help.. 
iis7 on win 2008 r2 , sql server express r2 , telerik ORM latest.. 
and still having this problem.. 
0
Jan Blessenohl
Telerik team
answered on 06 Jun 2011, 01:27 PM
Hello serkanp,
For me it looks like you have the application on a share that the OS does not count as secure or the sql server address is taken as external ip.
Any idea what you have changed prior to this exception?

Greetings,
Jan Blessenohl
the Telerik team
Q1’11 SP1 of Telerik OpenAccess is available for download; also available is the Q2'11 Roadmap for Telerik OpenAccess ORM.
0
serkanp
Top achievements
Rank 1
answered on 06 Jun 2011, 02:47 PM
hi jan, 
both sql server and web server are on the same server.  i already checked that answer from web, but my problem is not like that i think. 
in web.config the address of sql server is localhost
0
Jan Blessenohl
Telerik team
answered on 06 Jun 2011, 05:16 PM
Hello serkanp,
Maybe you have changed the IIS session to low trust? Can you have a look here?

Regards,
Jan Blessenohl
the Telerik team
Q1’11 SP1 of Telerik OpenAccess is available for download; also available is the Q2'11 Roadmap for Telerik OpenAccess ORM.
0
serkanp
Top achievements
Rank 1
answered on 06 Jun 2011, 06:43 PM
solved!
after adding those policy things/files to bin folder seen in attached screenshot .. it now starts working.. 
i dont know which one solved it but now without any problem and without any modification on iis settings, it works..

but in my another server(which has identically same configuration with this machine), i dont have the policy files in bin folder, it works.. 
0
Jan Blessenohl
Telerik team
answered on 07 Jun 2011, 12:36 PM
Hello serkanp,
That does not look like the real solution. Let me just guess what happened.

1. You had the OpenAccess assemblies in the local IIS directory
2. You have deleted those files and added them to the GAC
3. You have added the policy files as well.

The magic, if the assemblies are in the application folder, they derive the trust level from the IIS settings, if the assemblies are in the GAC, they always get full trust and your problem is gone.

Regards,
Jan Blessenohl
the Telerik team
Q1’11 SP1 of Telerik OpenAccess is available for download; also available is the Q2'11 Roadmap for Telerik OpenAccess ORM.
Tags
Getting Started
Asked by
serkanp
Top achievements
Rank 1
Answers by
serkanp
Top achievements
Rank 1
Jan Blessenohl
Telerik team
Share this question
or