If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Oracle > Need help.......try to connect to oracle 11g

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-11-12, 15:39
xmas1984 xmas1984 is offline
Registered User
 
Join Date: Jan 2012
Posts: 4
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!!!!!!!!!!
Reply With Quote
  #2 (permalink)  
Old 01-11-12, 16:11
anacedent anacedent is offline
Registered User
 
Join Date: Aug 2003
Location: Where the Surf Meets the Turf @Del Mar, CA
Posts: 6,416
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.
Reply With Quote
  #3 (permalink)  
Old 01-11-12, 16:55
xmas1984 xmas1984 is offline
Registered User
 
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 17:38.
Reply With Quote
  #4 (permalink)  
Old 01-11-12, 18:11
anacedent anacedent is offline
Registered User
 
Join Date: Aug 2003
Location: Where the Surf Meets the Turf @Del Mar, CA
Posts: 6,416
>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.
Reply With Quote
  #5 (permalink)  
Old 01-11-12, 18:32
xmas1984 xmas1984 is offline
Registered User
 
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 !!~!!
Reply With Quote
  #6 (permalink)  
Old 01-12-12, 09:21
beilstwh beilstwh is offline
Lead Application Develope
 
Join Date: Jun 2004
Location: Liverpool, NY USA
Posts: 2,222
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.
Reply With Quote
  #7 (permalink)  
Old 01-12-12, 10:25
xmas1984 xmas1984 is offline
Registered User
 
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
Reply With Quote
  #8 (permalink)  
Old 01-13-12, 00:07
edwin_fredrick edwin_fredrick is offline
Registered User
 
Join Date: Oct 2004
Posts: 44
Configure TNS from both the clients and check.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On