Oracle connectivity Issue with .Net

Oracle connectivity Issue with .Net

am 31.01.2008 12:22:26 von Saquib

Hi All,

I have built a simple .Net console application. In which i am trying
to connect to the oracle database by using Oracle data provider
for .Net from ORACLE site and it works fine on my machine. I have
installed the same on my main server but when i run this application
from Our main server i am getting an exception. The exception is as
follows.

'Oracle.DataAccess.Client.OracleException at
Oracle.DataAccess.Client.OracleException.HandleErrorHelper(I nt32
rrCode, OracleConnection conn, IntPtr opsErrCt
x, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure)
at Oracle.DataAccess.Client.OracleException.HandleError(Int32
errCode, Oracle
Connection conn, IntPtr opsErrCtx, Object src)
at Oracle.DataAccess.Client.OracleConnection.Open()
at TestODACWithWindows2000.Program.Main(String[] args)'


I am not able to trace out the exact cause why it is failing from that
server. While the oracle server is pingable from that server.

My application is as follows


using System;
using System.Collections.Generic;
using System.Text;
using Oracle.DataAccess.Client;
using System.Data.SqlClient;
using System.Xml;
using System.Data;
using System.Xml.XPath;
using System.Xml.Xsl;
using System.IO;

namespace TestODACWithWindows2000
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Opening........");
string ConnectionString = "Data
Source=(DESCRIPTION="
+
"(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=Host)(PORT=1521) ))"
+
"(CONNECT_DATA=(SERVER=DEDICATED)(SID = SID)));"
+ "User
Id=username;Password=password;";

OracleConnection ora = new
OracleConnection(ConnectionString);
try
{

ora.Open();


}
catch (Exception ee)
{
Console.WriteLine("{0} Exception caught.", ee);
Console.ReadLine();
}
}
}
}



Please help me out.. Its urgent.

Re: Oracle connectivity Issue with .Net

am 31.01.2008 12:27:02 von nemtsev

Hello Saquib,

Did u install oracle client to that PC where you site locates?

---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


S> Hi All,
S>
S> I have built a simple .Net console application. In which i am trying
S> to connect to the oracle database by using Oracle data provider
S> for .Net from ORACLE site and it works fine on my machine. I have
S> installed the same on my main server but when i run this application
S> from Our main server i am getting an exception. The exception is as
S> follows.
S> 'Oracle.DataAccess.Client.OracleException at
S> Oracle.DataAccess.Client.OracleException.HandleErrorHelper(I nt32
S> rrCode, OracleConnection conn, IntPtr opsErrCt
S> x, OpoSqlValCtx* pOpoSqlValCtx, Object src, String procedure)
S> at Oracle.DataAccess.Client.OracleException.HandleError(Int32
S> errCode, Oracle
S> Connection conn, IntPtr opsErrCtx, Object src)
S> at Oracle.DataAccess.Client.OracleConnection.Open()
S> at TestODACWithWindows2000.Program.Main(String[] args)'
S> I am not able to trace out the exact cause why it is failing from
S> that server. While the oracle server is pingable from that server.
S>
S> My application is as follows
S>
S> using System;
S> using System.Collections.Generic;
S> using System.Text;
S> using Oracle.DataAccess.Client;
S> using System.Data.SqlClient;
S> using System.Xml;
S> using System.Data;
S> using System.Xml.XPath;
S> using System.Xml.Xsl;
S> using System.IO;
S> namespace TestODACWithWindows2000
S> {
S> class Program
S> {
S> static void Main(string[] args)
S> {
S> Console.WriteLine("Opening........");
S> string ConnectionString = "Data
S> Source=(DESCRIPTION="
S> +
S> "(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=Host)(PORT=1521) ))"
S> +
S> "(CONNECT_DATA=(SERVER=DEDICATED)(SID = SID)));"
S> + "User
S> Id=username;Password=password;";
S> OracleConnection ora = new
S> OracleConnection(ConnectionString);
S> try
S> {
S> ora.Open();
S>
S> }
S> catch (Exception ee)
S> {
S> Console.WriteLine("{0} Exception caught.", ee);
S> Console.ReadLine();
S> }
S> }
S> }
S> }
S> Please help me out.. Its urgent.
S>