0

I'm trying to run my web app in Visual Studio but when I run it I get the following error: System.BadImageFormatException: Non è stato possibile caricare il file o l'assembly 'Oracle.VsDevTools.EntityFramework.16.0. What's the problem?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.OracleClient;
using Oracle.ManagedDataAccess;
using System.Data.OleDb;

namespace WebApplication
{

    public partial class WebForm1 : System.Web.UI.Page
    {
        string conString = "User Id=C##FABIO;Password=oracle;Data Source=localhost:1521/orcl;";
      
        protected void Page_Load(object sender, EventArgs e)
        {

        }



        //aggiungi un elemento alla tabella ESAMI
        protected void Button1_Click(object sender, EventArgs e)
        {
            OracleConnection con = new OracleConnection();
            con.ConnectionString = conString;
            con.Open();
            OracleCommand cmd = con.CreateCommand();
            cmd.CommandText = "Insert into ESAMI(CODICE_ESAME,NOME_ESAME,ANAGRAFICA_CODICE_FISCALE) VALUES('" + codice_esame_text.Text + "','" + nome_esame_text.Text + "','" + codice_fiscale_text.Text + "') WHERE ANAGRAFICA_CODICE_FISCALE = '" + codice_fiscale_text.Text + "'";
            cmd.ExecuteNonQuery();
            con.Close();
        
            
        }
    }
}
AndrewGB
  • 16,126
  • 5
  • 18
  • 49
fabio251996
  • 11
  • 1
  • 6
  • [Looks like](https://stackoverflow.com/questions/70316492/provider-oraoledb-oracle-not-registered) you struggle with your Oracle Client installation. Maybe have a look at http://stackoverflow.com/questions/34803106/how-to-connect-to-oracle-11-database-from-net/34805999#34805999 to get a first overview. You may also use [my tool](https://github.com/Wernfried/connection-tester) to check your actual Oracle Client installation. – Wernfried Domscheit Dec 11 '21 at 21:45
  • Reason might be the same as in your [previous question](https://stackoverflow.com/questions/70316492/provider-oraoledb-oracle-not-registered): The driver is not installed or you mixed 32-bit and 64-bit. Note. `System.Data.OracleClient` is deprecated for ages and may not work anymore with the latest Oracle Client. – Wernfried Domscheit Dec 11 '21 at 21:48

0 Answers0