1

I'm trying to access Oracle 11g DB. According to connectionstring.com , the connstring should be :

Driver={Oracle in OraClient11g_home1};Dbq=myTNSServiceName;Uid=user;Pwd=passwd;

Anyhow I'm getting an ArgumentException: 'Driver' is not a valid word.

Thank you.

Greetings

R. Bada

1 Answer 1

3

It looks like you are trying to use connection string which is suitable in case of ODBC drivers for Oracle.

You should look for connection string suitable for ODP.NET in Oracle Data Provider for .NET / ODP.NET section. The best is to use one of the following:

Data Source=TNSServiceName;User Id=user;Password=passwd;

or

Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=MyOracleSID)));User Id=user;Password=passwd;

The first is suitable when you are using TNS, the second allows you to provide the service definition in connection string.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you for reply. I have no tnsnamesnames file... So I would like to describe the service. But what should I put in MyOracleSID?
@user897237 The service_name may or may not be the ORACLE_SID. It is setup via the init.ora file with the "service_names" parameter. You can check this parameter by: select name, value from v$parameters where name like 'service%. Also remember that in case of second connection string other forms of Oracle Host String are acceptable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.