Click here to Skip to main content
15,895,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I am trying to get my code running on another PC. I have the code working properly on my old PC. Basically, I get the compile error "Type 'oracleconnection' is not defined".

I have System.Data,System.Data.OracleClient, and Oracle.DataAccess as Imports.

Can anyone help me as to why it would work on 1 PC and not another and how I could correct the errors?

Thanks,
Steve
Posted
Updated 28-Feb-17 10:59am
Comments
tiggerc 25-Jul-12 7:42am    
can you post the full error message? do you hav e a system DSN defined?
Dave Kreskowiak 25-Jul-12 10:11am    
Having a DSN has nothing to do with the problem. Really, a DSN is nothing more than a weirdly formatted connection string in a text file. Now a days, there's barely any reason to use them.
tiggerc 2-Aug-12 7:29am    
Cheers for that Dave, I was just thinking he may have set up a DSN and it couldn't find it.
CodingSteve 25-Jul-12 18:06pm    
"Type 'oracleconnection' is not defined" is the only error displayed
CodingSteve 20-Aug-12 6:55am    
Reply CodingSteve - 1 sec ago
Hi All,

I've tried the 2 suggestions that I have received buy, I haven't had any luck. I still get the same error: "Type 'oracleconnection' is not defined". I am really stuck. I've been trying to solve this for a long time. Does anyone else have any suggestions?

Thanks,
Steve

Install the Oracle client components on your "old" computer.
Actually, when you open that propject in Visual Studio, it should telll you that it could not load some dependencies (I do not know the exact wording of the error message); and in References, the respective components get a different icon telling you that something went wrong.
 
Share this answer
 
Comments
CodingSteve 25-Jul-12 18:04pm    
First off, thanks for answering. All the Oracle Components are installed on the "old" PC. It loads and compiles without any errors. I thought I have the proper Oracle components installed on the "new" PC. It doesn't give any errors loading it but, it does put the ""Type 'oracleconnection' is not defined" message on the bottom, when loaded, where you see compile error.
System.Data.OracleClient and Oracle.DataAccess both have an OracleConnection object. The compiler is not sure which one you want to us.
 
Share this answer
 
Comments
CodingSteve 20-Aug-12 6:54am    
Hi All, I've tried the 2 suggestions that I have received buy, I haven't had any luck. I still get the same error: "Type 'oracleconnection' is not defined".

I am really stuck. I've been trying to solve this for a long time. Does anyone else have any suggestions?

Thanks,
Steve
If oracle client is installed in your machine you can add the reference directly.
In VS 2012
1. Click on Add Reference
2. From Assemblies->Extensions Select Oracle.DataAccess
3. Imports Oracle.DataAccess.Client
 
Share this answer
 
v2
Comments
CHill60 26-May-15 5:44am    
This would not result in different behaviour on the two different PCs

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900