Click here to Skip to main content
15,907,000 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
I run 'Build' on my project without any error. Then I run Debugging, and got
HTML
Compiler Error Message: CS0234: The type or namespace name 'OracleClient' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)

on
C#
using System.Data.OracleClient;

In my project References, System.Data.OracleClient is in the list.
What's wrong here? Thanks.
Posted
Comments
Pranav-BiTwiser 12-Mar-14 12:52pm    
using Oracle.DataAccess.Client;
[no name] 12-Mar-14 14:04pm    
PB: Used Oracle.DataAccess.Client and revised my code a little bit, the compiling error was gone. Thanks. Please re-post your thread into Solution, so I can credit your recommendation. Thanks again.
Pranav-BiTwiser 18-Mar-14 14:20pm    
done..!! n thanks:)
your name?
[no name] 13-Mar-14 15:15pm    
PB: Did you read my message yesterday? I want to credit your work and then close this thread. Thanks.
[no name] 12-Mar-14 13:07pm    
1) What connection method I should use if using Oracle.DataAccess?
2) Just realized that System.Data.OracleClient.OracleConnection is obsolete, but it is still available?
Thanks.

using Oracle.DataAccess.Client;
 
Share this answer
 
You are missing assembly reference. What is unclear? Add reference. Use "Add Reference" node in Solution Explorer. There is a separate assembly "System.Data.OracleClient". See the documentation on any of the Oracle-related classes to see it, for example: http://msdn.microsoft.com/en-us/library/system.data.oracleclient.oraclecommand%28v=vs.110%29.aspx[^].

It looks like you are not yet ready for database development and other advanced topics (UI, network, virtually nothing). First, you need to learn .NET basics. In particular, such things as
http://msdn.microsoft.com/en-us/library/ms973231.aspx[^].

—SA
 
Share this answer
 
Comments
[no name] 12-Mar-14 13:28pm    
SA: I did use the same procedure as you mentioned your Solution to Add Reference. This dll has been registered and is located at C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Data.OracleClient.dll. For the document, I also realized that the System.Data.OracleClient is obsolete. I did NOT miss the assembly reference. As I mentioned, it is appears to be strange somehow that no build error but displayed a compile error when when running debugging.
I wish you understood my question and then made a conclusion. Thanks anyway.
Sergey Alexandrovich Kryukov 12-Mar-14 13:37pm    
I am sorry, but this is what I could see from your question that it wasn't references, because you have correct namespace; there is no other way to have this error message. Maybe you added the reference later; I don't know.

Look, I'm really sorry if I made some wrong conclusion, but this is only because you formulated the question the way you did.

Having some obsolete API is a different question; you never mentioned it in first place.

—SA
[no name] 12-Mar-14 13:45pm    
SA: Thanks for your comment here. I just got a problem I have never seen. I will try for the solution. Per your post, it alerts me to write clearer statement in my posted thread. I will try to improve it. Thanks again.
[no name] 12-Mar-14 14:05pm    
Problem solved by using using Oracle.DataAccess. See my respond to Pranav Bilurkar. Thanks for your review.
Sergey Alexandrovich Kryukov 12-Mar-14 14:35pm    
Great. And I really appreciate your understanding and your very constructive approach to responding to some criticism. This is one of the main prerequisites for success.
—SA
Problem solved by adding reference: using Oracle.DataAccess.Client;
The solution was proposed by Pranav Bilurkar in his comment.
 
Share this answer
 

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