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

7 posts, 0 answers
  1. serkanp
    serkanp avatar
    14 posts
    Member since:
    Jul 2007

    Posted 01 Jun 2011 Link to this post

    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 

  2. serkanp
    serkanp avatar
    14 posts
    Member since:
    Jul 2007

    Posted 03 Jun 2011 Link to this post

    still need help.. 
    iis7 on win 2008 r2 , sql server express r2 , telerik ORM latest.. 
    and still having this problem.. 
  3. DevCraft banner
  4. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 06 Jun 2011 Link to this post

    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.
  5. serkanp
    serkanp avatar
    14 posts
    Member since:
    Jul 2007

    Posted 06 Jun 2011 Link to this post

    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
  6. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 06 Jun 2011 Link to this post

    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.
  7. serkanp
    serkanp avatar
    14 posts
    Member since:
    Jul 2007

    Posted 06 Jun 2011 Link to this post

    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.. 
  8. Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 07 Jun 2011 Link to this post

    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.
Back to Top
DevCraft banner