Wednesday, October 16, 2013

The type or namespace name 'OracleConnection' Could not be found C#

Hello,

In C# you you might have receive a type or namespace missing error like the one below
The type or namespace name 'OracleConnection' could not be found (are you missing a using directive or an assembly reference?)

The type or namespace name 'OracleCommand' could not be found (are you missing a using directive or an assembly reference?)

The type or namespace name 'OracleDataReader' could not be found (are you missing a using directive or an assembly reference?)     


This means that c# was unable to find the reference to for the following classes

               OracleConnection conn
               OracleCommand cmd
               OracleDataReader
All these classes are required to connect Oracle with c#

So in order to fix this error we will need to add dll(references) files for these classes.

Download dll from HERE
File is password protected, password is taqi

1. Download the dlls from link provided above

2. Now in C# right click on your project, and than click on Add reference

3. Click on Browse Tab

4. Now add the 3 files which you downloaded above

5. Click ok

Now Your code will compile without the namespace error

I hope it was informative for you and I would like to Thank you for reading.

Thanks

7 comments:

  1. download link isn't working ??
    PLS HELP... :-(

    ReplyDelete
    Replies
    1. Hi,
      I have checked the link, and it is working fine on my side.

      please try again

      Delete
    2. can you tell me which 3 files are downloaded in the link.
      i tried several times and whats the reason for this. Help me because i m stuck at this point

      Delete
    3. use the below link

      http://www.4shared.com/rar/QgDukj_w/oracle_dlls.html

      Do let me know if it works or not...

      Delete
  2. hey dude link is working perfectly BUT
    the downloaded zip file needs password to open
    can you tell me that... pls

    ReplyDelete