Click here to Skip to main content
15,914,162 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have one windows service which is taking data from oracle and put it in SQL server i have wrote the connection code but its giving me this error
ORA-06413: Connection not open.

i have checked for TNS file and i have mentioned full path in config file please give me solution
This is while im trying to fetch data from oracle
Thanks in advance

What I have tried:

Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.161.50.101)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=MOUAT)));Password=password;User Id=username;



public OracleConnection ConnectDB(OracleConnection dbConnection)
        {
            try
            {
                if (dbConnection.State != ConnectionState.Open)
                {
                    dbConnection.Open();
                }
                return dbConnection;
            }
            catch (DbException exp)
            {
                return null;
            }
        }
Posted
Updated 15-Mar-17 2:53am
Comments
Prashant. B. Chavan 15-Mar-17 5:30am    
Check if below link helps you,

https://www.codeproject.com/Questions/778445/ORA-Connection-not-open
ZurdoDev 15-Mar-17 7:03am    
Which line of code causes the error?
Member 12966735 15-Mar-17 7:26am    
dbConnection.Open();
this line of code gives error
Member 12966735 15-Mar-17 8:20am    
now i have changed build option from x86 to any cpu but now its giving error like 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. please help me

1 solution

See my solution to your other post Select data from oracle database and insert into SQL server[^]
Were you aware that you can use the Improve question link to add information to your post? This is preferable to posting a new question if you have not received any solution responses to your original.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900