Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2009
    Posts
    3

    Unanswered: ORA-12541: TNS:No listener

    I am developing a small tool using Visual c#2005 which is used to get the Oracle Schema version. When I tested it in my machine it works fine. When my boss tested the same in his machine it brings out the message TNS-NO LISTENER. He says listener is running in his machine & says the problem is in the code (He is an Oracle DBA and a well experienced person). The code is just a few lines & I think there is nothing wrong in it. I don't know how to solve this problem. I have tested it in my machine at home, it works good there also.

    I am a novice when it comes to Oracle & wondering where the problem could be. Please find below the connection strings I have used so far, all the below mentioned connection strings are working fine for my machine but not for my boss.

    1) sconncectin = "Server = Servername; Uid = username; password = password";

    2) sconncectin = "provider=MSDAORA;data source=TEST;user id=demo;password=demo123";

    3)sconncectin = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOC OL=TCP)(HOST=MYHOSTNAME)(PORT=1251)))(CONNECT_DATA =(SERVER=DEDICATED)(SERVICE_NAME=TEST)));User Id=demo;Password=demo123;";

    My boss says the connection method itself is wrong and said not to worry about port, host etc since TNSNAMES is available !!

    Wondering how to fix this issue?

    Can someone help me out??????

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >Can someone help me out??????
    >3)sconncectin = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOC OL=TCP)(HOST=MYHOSTNAME)(PORT=1251)))(CONNECT_DATA =(SERVER=DEDICATED)(SERVICE_NAME=TEST)));User Id=demo;Password=demo123;";

    well boss' machine likely does not know which PC is "MYHOSTNAME".
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Nov 2003
    Posts
    2,933
    Provided Answers: 12
    Why don't you simply use the TNS name (defined in tnsnames.ora) instead of supplying a full connection string (I guess that's what your boss was referring to).

  4. #4
    Join Date
    Aug 2009
    Posts
    3
    @ Anacedent,

    Well, that was an example string given by me, I have a UI from which he will enter all those details.

    @ Shammat,

    Can you please tell me how to use TNSNAME?

  5. #5
    Join Date
    Aug 2009
    Posts
    3
    Well... The problem was with the connection string, I have changed the connection string as follows,
    Provider=msdaora;Data Source=MyOracleDB;User Id=myUsername;Password=myPassword;
    Now it works good in his machine!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •