Path: dp-news.maxwell.syr.edu!spool.maxwell.syr.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!postnews.google.com!i39g2000cwa.googlegroups.com!not-for-mail
From: "TRW" <timothy.williams@comverse.com>
Newsgroups: comp.databases.oracle.misc
Subject: .Net OracleConnection Issue
Date: 3 Mar 2006 08:37:01 -0800
Organization: http://groups.google.com
Lines: 69
Message-ID: <1141403821.712723.239380@i39g2000cwa.googlegroups.com>
NNTP-Posting-Host: 12.170.53.2
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1141403828 27001 127.0.0.1 (3 Mar 2006 16:37:08 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 3 Mar 2006 16:37:08 +0000 (UTC)
User-Agent: G2/0.2
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: i39g2000cwa.googlegroups.com; posting-host=12.170.53.2;
   posting-account=Qm7m2A0AAADe3rrna9bsF-kVY_1MOR_K
Xref: dp-news.maxwell.syr.edu comp.databases.oracle.misc:125658

Hello, I'm using the oracleclient namespace to attempt to connect to a
Oracle 8 db on a server.

I have the following code:


try
            {
                string connectionString = "Data Source=ODS;User
ID=xxx;Password=xxx";
                using (OracleConnection mdgDBconn = new
OracleConnection(connectionString))
                {
                    mdgDBconn.Open();
                    Console.WriteLine("ServerVersion: " +
mdgDBconn.ServerVersion
                        + "\nDataSource: " + mdgDBconn.DataSource);
                }
            }
            catch (OracleException exc)
            {
                MessageBox.Show(exc.Message);
            }


An exception is thrown saying


ORA-125-05 TNS listener can not resolve SID given in the connect
descriptor.


I have the ODS in my tsnames.ora file shown:


ODS =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.207.249.2)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID = ODS)
    )
  )


If I use the tnsping ODS command, I get a "OK" response
Also, I use the tnsping <ip>, I get the "OK" response.


If I change the connection string to use the IP address instead of the
Service name, I get this exception.


ORA-12514: TNS:listener could not resolve SERVICE_NAME given is connect

descriptor.


Any idea what is the problem?  I must be missing something in my Oracle

setup. 


thanks 


TRW

