Oracle - works with Framework 1.1, not with 2.0

C

Chris Botha

Hi, sorry, cross-post with the ADONET newsgroup.

I have a web site on a 2003 server. The web site runs under Framework
1.1 and works with oracle, no problem.
On the same server I have another web site that runs under Framework 2.0 and
connects to the same Oracle database, same connection string. In this case I
get the following error:
ORA-12154: TNS:could not resolve service name

Thanks
 
F

Fred Exley

Chris Botha said:
Hi, sorry, cross-post with the ADONET newsgroup.

I have a web site on a 2003 server. The web site runs under Framework
1.1 and works with oracle, no problem.
On the same server I have another web site that runs under Framework 2.0
and
connects to the same Oracle database, same connection string. In this case
I
get the following error:
ORA-12154: TNS:could not resolve service name

Thanks


I'm using the .Net 2.0 Framework and Oracle 10g. This works for me :

C# code:
----------

using Oracle.DataAccess.Client;
OracleConnection foodConnQ = new OracleConnection("Persist Security
Info=True;User ID=monte;Password=zsdccc;Data Source=epicur;");
OracleDataAdapter ingr1DAq = new OracleDataAdapter("SELECT * FROM v2 where
NDB_No = :NDB_No", foodConnQ);
ingr1DAq.SelectCommand = new OracleCommand("SELECT * FROM v2 where NDB_No =
:NDB_No", foodConnQ);



my local tnsnames file:
----------------------

# tnsnames.ora Network Configuration File:
C:\oracle\product\10.1.0\Client_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
EPICUR =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = monteamd)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = epicur)
)
)

-Fred
 
C

Chris Botha

Hi Fred, thanks for the info. My tnsnames.ora is good - Framework 1.1 works
with it happily.
I was thinking along the lines of a security problem, that Framework 2.0
cannot access the Oracle directory maybe? Did you have to change directory
security on the machine? I gave the ASPNET user full control on the Oracle
directory and sub-directories, but maybe Framework 2.0 uses another account?
I installed the Framework 2.0 from the Distributable download, so it may be
a bit different than the VS2005 install.

Thanks.
 
F

Fred Exley

Chris Botha said:
Hi Fred, thanks for the info. My tnsnames.ora is good - Framework 1.1
works with it happily.
I was thinking along the lines of a security problem, that Framework 2.0
cannot access the Oracle directory maybe? Did you have to change directory
security on the machine? I gave the ASPNET user full control on the Oracle
directory and sub-directories, but maybe Framework 2.0 uses another
account?
I installed the Framework 2.0 from the Distributable download, so it may
be a bit different than the VS2005 install.

Thanks.


I started with 2.0, so don't know what's changed. I do remember having to
screw around with tnsnames.ora to get it working, even though it worked ok
with other apps. I suspect it's some finepoint in your service names syntax
in tnsnames.ora.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top