Skip to Main Content

ODP.NET

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

type initializer ...OracleConnection threw an exception?

VronNov 12 2009 — edited Nov 13 2009
Please help. I have been fighting this for several days.
Trying to implement a SharePoint web part that calls Oracle using ODP for NET 2.0 11.1.0.6.20
When I call the page that includes the web part, it shows that Oracle.DataAccess.Client threw an exception.
On the SP server, the error detail is:
------
System.TypeInitializationException was unhandled
Message="The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception."
Source="Oracle.DataAccess"
TypeName="Oracle.DataAccess.Client.OracleConnection"
StackTrace:
at Oracle.DataAccess.Client.OracleConnection.Dispose(Boolean disposing)
at System.ComponentModel.Component.Finalize()
InnerException: System.Security.SecurityException
Message="Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."
Source="Oracle.DataAccess"
GrantedSet=
----------
I have added several lines to web.config:
<SafeControl Assembly="Oracle.DataAccess, Version=2.111.6.20, Culture=neutral, PublicKeyToken=89b483f429c47342" Namespace="Oracle.DataAccess" TypeName="*" Safe="True" />
<SafeControl Assembly="Oracle.DataAccess, Version=2.111.6.20, Culture=neutral, PublicKeyToken=89b483f429c47342" Namespace="Oracle.DataAccess.Client" TypeName="*" Safe="True" />
<SafeControl Assembly="Oracle.DataAccess, Version=2.111.6.20, Culture=neutral, PublicKeyToken=89b483f429c47342" Namespace="Oracle.DataAccess.Client" TypeName="OracleConnection" Safe="True" />
<SafeControl Assembly="Oracle.DataAccess, Version=2.111.6.20, Culture=neutral, PublicKeyToken=89b483f429c47342" Namespace="Oracle.DataAccess.Types" TypeName="*" Safe="True" />

to no avail.

Any help would be greatly appreciated.
Thanks!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 11 2009
Added on Nov 12 2009
4 comments
4,049 views