Oracle Data Access

Hi,

I want to make a data access to an oracle-db. I added references to System.Data.OracleClient and Oracle.DataAccess into my project. But when I compile the code, which is below, I get the error
...\OracleTest.cs(13,5): error CS0246: Der Typ oder Namespace 'OracleClient' konnte nicht gefunden werden. Möglicherweise fehlt eine Anweisung oder ein Assemblyverweis.





using System;
using System.Data.OracleClient;


namespace OracleTest {

      public class OracleTest  {

        // The main entry point for the process
        static void Main() {
                  try {
                        // Connection
                        OracleClient.OracleConnection m_orclconn =
                              new OracleClient.OracleConnection ();
                        // TODO: Modify the connection string and include any
                        // additional required properties for your database.
                        m_orclconn.ConnectionString = "Data Source=Oracle10g;Integrated Security=yes;"+
                              "Server=dialer;Uid=scott;Pwd=admin";
                        try {
                              m_orclconn.Open();
                              // Insert code to process data.
                        }
spetrowitschAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
Loose translation:
The Type or Namespace 'OracleClient' could not be found.  Possibly an instruction or an assembly reference is missing.

If have 'using System.Data.OracleClient;' then try this:

public class OracleTest  {

        // The main entry point for the process
        static void Main() {
               try {
                    // Connection
                    OracleConnection m_orclconn = new OracleConnection ();

                    // TODO: Modify the connection string and include any
                    // additional required properties for your database.
                    m_orclconn.ConnectionString = "Data Source=Oracle10g;Integrated Security=yes;"+
                         "Server=dialer;Uid=scott;Pwd=admin";
                    try {
                         m_orclconn.Open();
                         // Insert code to process data.
                    }

Bob

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
spetrowitschAuthor Commented:
I tried that, and got a new message:

c:\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Data.OracleClient.dll: error CS0011: Die referenzierte Klasse 'System.Data.OracleClient.OracleConnection' hat eine Basisklasse oder Schnittstelle 'System.ComponentModel.Component', die in einer nicht referenzierten Assembly definiert ist. Fügen Sie einen Verweis auf Assembly 'System' hinzu.


But there is a reference to Assembly System...
spetrowitschAuthor Commented:
Hi,

I made some other references, and now I can compile it. But still I get the message (when I debug the code)
ORA-01017: Invalid usernam/password: logon denied, despite the fact, that I can with this combination of username/password/sid (which is written after "Server") I can connect with SQL Plus. Any hint?

spetrowitschAuthor Commented:
o.k., I should set "Integrated Security" to "no", if I want to give it "User ID" and "Password" (not "Uid" and "Pwd")
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.