0

Here is Oracle connection and command. I couldn't understand the problem:

public ActionResult Index()
{
    OracleConnection con = new OracleConnection("some sql connection connection");
    con.Open();
    OracleCommand md = new OracleCommand("insert into teachers",cm);
    md.ExecuteNonQuery();
    con.Close();
    return View();
}

Error:

Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load a program with an incorrect form

krlzlx
  • 5,752
  • 14
  • 47
  • 55

1 Answers1

0

Check following points:

  • The ODP.NET (i.e. Oracle.DataAccess.dll) is installed (Oracle Instant Client does not include ODP.NET)
  • It has the same architecture (i.e. 32-bit or 64-bit) as your application
  • Architecture of Oracle Client and ODP.NET must be the same
  • Version of Oracle Client and ODP.NET is the same (even up to the minor version number)
Wernfried Domscheit
  • 54,457
  • 9
  • 76
  • 110