skip to Main Content

I’m trying to connect my db with my asp.net web form but when i insert this to try the connection i’ve this error

      OleDbConnection con = new OleDbConnection("Provider=OraOLEDB.Oracle;USER ID=C##FABIO;DATA SOURCE=ORCL");

    //aggiungi un elemento alla tabella ESAMI
    protected void Button1_Click(object sender, EventArgs e)
    {
        con.Open();
        OleDbCommand cmd = new OleDbCommand("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 + "'",con);
        cmd.ExecuteNonQuery();
        con.Close();

how can i add the oracle provider?

2

Answers


  1. Literally, it means the OleDB Provider for Oracle in not registered, you can register it with

    %windir%System32RegSvr32.exe "<path of OraOLEDB11.DLL 64-bit version>"
    %windir%SysWOW64RegSvr32.exe "<path of OraOLEDB11.DLL 32-bit version>"
    

    However, usually this is not the root cause of your problem. In most cases the OleDB Provider is not installed at all. The bare Oracle Instant client does not include the Oracle Provider for OLE DB, either you install is separately or you need to enable the component in the Oracle Universal Installer.

    You can download the Oracle Provider for OLE DB from here:

    Note, the architecture, i.e. 32-bit vs. 64-bit must match with your compiler settings, you cannot mix it. Often people mix the 32 and 64-bit versions, they are named and looking equally.

    The version of Oracle Provider for OLE DB (e.g. 12.2) must match with the version of the Oracle Client. You can install only one version of the Oracle Provider for OLE DB (i.e. one each for 32-bit and 64-bit), it’s a limitation of the Windows COM architecture. So, run your installation carefully.

    Login or Signup to reply.
  2. When installing odac from command line (ODAC183Xcopy_x64.zip -> install.bat) I noticed that the path was updated (echo %path%) to include the oracle bin folder, so I thought everything should be working, but still received the Provider OraOLEDB.Oracle not registered error message, then I noticed that if I open a new command prompt window, the path to the oracle bin folder was no longer included in the windows path, so I had to manually add the paths for the oracle and oracle bin folders to the windows path environment variable.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search