problem in opening DB connection in C# to Oracle

I have the following source code (see the end of this msg)  in my  TestOracle app.
But it is always giving error:
System.Data.OracleClient.OracleException: Error while trying to retrieve text for error ORA-12154

   at System.Data.OracleClient.DBObjectPool.GetObject(Object owningObject, Boolean& isInTransaction)
   at System.Data.OracleClient.OracleConnectionPoolManager.GetPooledConnection(String encryptedConnectionString, OracleConnectionString options, OracleConnection owningObject, Boolean& isInTransaction)
   at System.Data.OracleClient.OracleConnection.OpenInternal(OracleConnectionString parsedConnectionString, Object transact)
   at System.Data.OracleClient.OracleConnection.Open()
   at TestOracle.Form1..ctor() in c:\testoracle\testoracle\form1.cs:line 38

What's wrong?

Thanks a lot.

Jennifer

=========================================

String connString="Data Source=Oracle8i;Server=testserver;Uid=jennifer;Pwd=welcome";
                  OracleConnection conn = new OracleConnection(connString);
                  
                  
                  try
                  {
                        conn.Open();
                  }
                  catch(Exception e)
                  {
                        Console.WriteLine(e.ToString());
                  }
                  finally
                  {
                        conn.Close();
                  }

jfz2004Asked:
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.

ryerrasCommented:
Hmm looks like, your connection string is in incorrect format

it should be
String connString="User id=jennifer;Password=welcome;source=testserver";

now try
0
Chester_M_RagelCommented:
0
Razzie_Commented:
Take a look at this previous asked question about the exact same error:

http://www.experts-exchange.com/Databases/Crystal_Reports/Q_20788720.html

HTH,

Razzie
0

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
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

jfz2004Author Commented:
Hi,  ryerras,

Thanks for your input. But I tried:
String connString="User id=jennifer;Password=welcome;source=testserver";
Still got the same error.

Jennifer
0
jfz2004Author Commented:
Hi, Chester_M_Ragel,

I checked that I do have tnsnames.ora and it contains
the correct names.

Thanks,

Jennifer
0
ryerrasCommented:
ok. Did you try to login in sqlplus, is that working? what version of oracle client are you using?
0
jfz2004Author Commented:
Hi,
Thanks for all the help. I just found out what was wrong.
Here's how I figured it out:
1. I sent the source to my co-worker and he could run it on his
machine without any problem.
2. That means some setting is not right on my machine.
3. So I checked that my tnsnames.ora is there and readable and correct.
4. Finally, I checked that we compare our registry and found I don't
have ORACLE in my registry.

After I inserted the registry the ORACLE, it worked.

What a learning curve!

Thanks for all your help!

Jennifer
0
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.