Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2012
    Posts
    4

    Unanswered: Need help.......try to connect to oracle 11g

    I'm trying to connect to oracle database with VS .net 2010 under windows server 2008

    Before i had this error:
    Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed

    I installed oracle 11g 64bit and 32 bit on the same machine, and now it gives me a new error:
    ORA-12541: TNS no listener

    i check my listener under Services, and it's running. i also checked the listener.ora and tnsnames.ora file, didn't find anything wrong.

    when i tried to connect to oracle with c# code, and i got this error:
    System.Data.Odbc.OdbcException (0x80131937): ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed ERROR [01000] [Microsoft][ODBC Driver Manager] The driver doesn't support the version of ODBC behavior that the application requested (see SQLSetEnvAttr).

    here is the code:

    System.Data.Odbc.OdbcConnection link = new System.Data.Odbc.OdbcConnection();
    link.ConnectionString = @"Driver={Microsoft ODBC for Oracle}; Data source = XXXX; " +
    "Port = XXXX" +
    "Server = XXXX; ";

    i can't use System.Data.OracleClient, because:
    The type or namespace name 'OracleClient' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)

    I'm a beginner, and i did a lot of searches on the internet, and none of them works. Is there any one can help me, give me some tips. I really appreciate that, have been worked on this for few days.

    Thanks so much!!!!!!!!!!

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    on DB Server open Command Window & issue following OS commands

    lsnrctl status
    lsnrctl service

    COPY commands & results then PASTE all back here
    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
    Jan 2012
    Posts
    4
    Quote Originally Posted by anacedent View Post
    on DB Server open Command Window & issue following OS commands

    lsnrctl status
    lsnrctl service

    COPY commands & results then PASTE all back here
    C:\Users\Administrator>lsnrctl service

    LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 11-JAN-2012 14:21
    :39

    Copyright (c) 1991, 2010, Oracle. All rights reserved.

    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC15 22)))
    Services Summary...
    Service "ODSPROD" has 1 instance(s).
    Instance "ODSPROD", status UNKNOWN, has 1 handler(s) for this service...
    Handler(s):
    "DEDICATED" established:0 refused:0
    LOCAL SERVER
    The command completed successfully



    C:\Users\Administrator>lsnrctl status

    LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 11-JAN-2012 14:20
    :37

    Copyright (c) 1991, 2010, Oracle. All rights reserved.

    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC15 22)))
    STATUS of the LISTENER
    ------------------------
    Alias listener
    Version TNSLSNR for 64-bit Windows: Version 11.2.0.1.0 - Produ
    ction
    Start Date 11-JAN-2012 14:18:26
    Uptime 0 days 0 hr. 2 min. 12 sec
    Trace Level off
    Security ON: Local OS Authentication
    SNMP OFF
    Listener Parameter File C:\app\Administrator\product\11.2.0\dbhome_1\netwo rk\a
    dmin\listener.ora
    Listener Log File c:\app\administrator\diag\tnslsnr\WIN-THC1JTF909H\list
    ener\alert\log.xml
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\ pipe\EXTPROC1522ipc)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=WIN-THC1JTF909H)(PORT=1522)))
    Services Summary...
    Service "ODSPROD" has 1 instance(s).
    Instance "ODSPROD", status UNKNOWN, has 1 handler(s) for this service...
    The command completed successfully

    thank you~!!
    Last edited by xmas1984; 01-11-12 at 18:38.

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >I installed oracle 11g 64bit and 32 bit on the same machine, and now it gives me a new error:
    I missed above before.
    This means that 2 ORACLE_HOME trees exist; which can complicate & confuse things.
    I would have advised against doing it.
    Good Luck at unscrambling this environment!
    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.

  5. #5
    Join Date
    Jan 2012
    Posts
    4
    Quote Originally Posted by anacedent View Post
    >I installed oracle 11g 64bit and 32 bit on the same machine, and now it gives me a new error:
    I missed above before.
    This means that 2 ORACLE_HOME trees exist; which can complicate & confuse things.
    I would have advised against doing it.
    Good Luck at unscrambling this environment!
    Thank you !!~!!

  6. #6
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    What is the client version that you are running?
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  7. #7
    Join Date
    Jan 2012
    Posts
    4
    Quote Originally Posted by beilstwh View Post
    What is the client version that you are running?
    oracle database 11g

  8. #8
    Join Date
    Oct 2004
    Posts
    60
    Configure TNS from both the clients and check.

Posting Permissions

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