connection string with service name

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
zajda82
Posts: 1
Joined: Sat 31 Jan 2009 14:06

connection string with service name

Post by zajda82 » Tue 17 Mar 2009 13:26

Hello,

I am deploying ASP.NET application to customer site. This application uses .connect for oracle and entity framework.

For connection to database in development environment I use Host, Username, Password and SID.

For connection to customers database I am supposed to use following:

Code: Select all

TLIMON.CUSTOMER-DB=(DESCRIPTION=(ADDRESS_LIST=(FAILOVER=OFF)(LOAD_BALANCE=OFF)
(ADDRESS=(PROTOCOL=TCP)(HOST=some.host.customer.vwg)(PORT=1521)))
(CONNECT_DATA=(SERVICE_NAME=tlimon.cust.customer.vwg)))
When I modify my connection string to use these values, underlying provider fails to open. Also when I tried to connect using devart entity developer I got error message: Invalid SID. Connection string looks as following:

Code: Select all

metadata=res://*/DataModel.csdl|res://*/DataModel.ssdl|res://*/DataModel.msl;
provider=Devart.Data.Oracle;provider connection string="
User Id=SOMEUSER;Password=p@$$w0rd;Server=some.host.customer.vwg;Direct=True;
Service Name=tlimon.cust.customer.vwg;Persist Security Info=True"
Database is working correctly because I was able to connect using Oracle sql developer.

Anyone has an idea how should I modify my connection string to get it work?

Thanks in advance for answer.

Peter

Shalex
Site Admin
Posts: 8248
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Wed 18 Mar 2009 11:53

1. Your customer's environment should be informed about the existence of the provider factory. The provider factory is described either in machine.config (globally) or in web.config (just for your application), but not in both files. Assuming that you use dotConnect for Oracle, this is done as follows:

Code: Select all


  
    
    
  

Replace 5.0.13.0 here with your actual version.

2. SID is not a service name. It is a name of the database instance. If you have the Direct=True entry in your connection string, you should not use the Service Name parameter (please remove it), and set the SID parameter. E.g.: SID=tlimon. Find the name of your database instance and try placing it in your connection string.

Post Reply