SQL Server: The type initializer for 'Oracle.DataAccess.Client.OracleParameter' threw an exception

567 views Asked by At

After googling out a lot this seems a unique situation hope I find answer to it.

Problem: I am trying to execute a .net console application from SQL server using XP_CMDSHELL

For e.g

XP_CMDSHELL '\\sharedlocation\sharedfolder\dotnetconsoleapp.exe'

I am able to execute this successfully when I execute this exe from regular command prompt but face below error when i use XP_CMDSHELL to execute this console application.

The type initializer for 'Oracle.DataAccess.Client.OracleParameter' threw an exception.

Way of Implementation

  • Have a 3 layer architecture console application calling business layer and business layer calling Data Layer
  • Data Layer is using Oracle.DataAccess 4.112.3.0 from Add Referance -> Assembly -> Extensions
  • Using that dll I was able to execute stored procedure at Oracle 11G server
  • Error Recieved

    The type initializer for 'Oracle.DataAccess.Client.OracleParameter' threw an exception.

    Please do let me know if I should have provided more information here. Appreciate help from all techies here....

    0

    There are 0 answers