k4yaman
k4yaman

Reputation: 485

Devart dotConnect Express for Oracle Connection with service name

I have the version 9.1.131.0.

I want to connect to a Oracle 12 DB with a Service Name. I have the login, pw, server, but it seems i can't add a service name or port to OracleConnectionStringBuilder.

How do i connect to my db with a service name?

I can make it happen with Oracle.ManagedDataAccess but due to performance issues i want to test if the Devart Driver is working better.

kind regards

Upvotes: 1

Views: 5776

Answers (2)

Wernfried Domscheit
Wernfried Domscheit

Reputation: 59522

Try SID instead of Service Name. I found this one: Using Direct Mode

SID** System identifier (Global Database Name)

** The Service Name connection string parameter can be used instead of SID, but in the Direct Mode you can connect only to one database instance (RAC isn't supported).

For me this works:

var str = new DbConnectionStringBuilder(false);
str.Add("Data Source", db);
str.Add("User ID", user);
str.Add("Password", pw);
var con = new Devart.Data.Oracle.OracleConnection(str.ConnectionString);
con.Open();

You can also put full connection string as data source instead of retrieving the alias from tnsnames.ora file, e.g.

string db = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST={host})(PORT=1521))(CONNECT_DATA=(SERVICE_NAME={serviceName})))";
str.Add("Data Source", db);

Upvotes: 1

k4yaman
k4yaman

Reputation: 485

So this is my conclusion:

Since I don't want my users to install the Oracle Client or a install package more than 10 MB, the Devart dotConnect Express for Oracle will not work.
Quote from exception:
"Express Edition doesn't support Direct mode. Do not use Direct parameter of connection string. Refer to dotConnect for Oracle editions matrix."

Thanks for the help.

Kind regards

Upvotes: 0

Related Questions